mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fix textbox text offset & fix invisible alerts
This commit is contained in:
parent
4574aa1ec9
commit
8ce6c691c6
2 changed files with 5 additions and 3 deletions
|
|
@ -592,7 +592,10 @@ void Hud::draw(const DrawContext& ctx){
|
|||
const uint height = viewport.getHeight();
|
||||
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);
|
||||
|
||||
uicamera->setFov(height);
|
||||
|
|
@ -693,7 +696,6 @@ void Hud::setPause(bool pause) {
|
|||
if (pause && !menu->hasOpenPage()) {
|
||||
menu->setPage("pause");
|
||||
}
|
||||
menu->setVisible(pause);
|
||||
}
|
||||
|
||||
Player* Hud::getPlayer() const {
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ void TextBox::setCaret(size_t position) {
|
|||
scrolled(-glm::ceil(offset/static_cast<double>(scrollStep)+0.5f));
|
||||
}
|
||||
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) {
|
||||
setTextOffset(textOffset + realoffset-width);
|
||||
} else if (realoffset < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue