fix textbox text offset & fix invisible alerts
This commit is contained in:
parent
577655504e
commit
6500f9b6f3
@ -592,7 +592,10 @@ void Hud::draw(const DrawContext& ctx){
|
|||||||
const uint height = viewport.getHeight();
|
const uint height = viewport.getHeight();
|
||||||
auto menu = gui.getMenu();
|
auto menu = gui.getMenu();
|
||||||
|
|
||||||
darkOverlay->setVisible(menu->hasOpenPage());
|
bool is_menu_open = menu->hasOpenPage();
|
||||||
|
darkOverlay->setVisible(is_menu_open);
|
||||||
|
menu->setVisible(is_menu_open);
|
||||||
|
|
||||||
updateElementsPosition(viewport);
|
updateElementsPosition(viewport);
|
||||||
|
|
||||||
uicamera->setFov(height);
|
uicamera->setFov(height);
|
||||||
@ -693,7 +696,6 @@ void Hud::setPause(bool pause) {
|
|||||||
if (pause && !menu->hasOpenPage()) {
|
if (pause && !menu->hasOpenPage()) {
|
||||||
menu->setPage("pause");
|
menu->setPage("pause");
|
||||||
}
|
}
|
||||||
menu->setVisible(pause);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Player* Hud::getPlayer() const {
|
Player* Hud::getPlayer() const {
|
||||||
|
|||||||
@ -826,7 +826,7 @@ void TextBox::setCaret(size_t position) {
|
|||||||
scrolled(-glm::ceil(offset/static_cast<double>(scrollStep)+0.5f));
|
scrolled(-glm::ceil(offset/static_cast<double>(scrollStep)+0.5f));
|
||||||
}
|
}
|
||||||
uint lcaret = caret - label->getTextLineOffset(line);
|
uint lcaret = caret - label->getTextLineOffset(line);
|
||||||
int realoffset = font->calcWidth(input, lcaret)-int(textOffset) - padding.x;
|
int realoffset = font->calcWidth(input, lcaret)-int(textOffset) + 2;
|
||||||
if (realoffset-width > 0) {
|
if (realoffset-width > 0) {
|
||||||
setTextOffset(textOffset + realoffset-width);
|
setTextOffset(textOffset + realoffset-width);
|
||||||
} else if (realoffset < 0) {
|
} else if (realoffset < 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user