Skip to content

Commit

Permalink
fix textbox horizontal scroll & fix console log width
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Jan 21, 2025
1 parent 85600ea commit 13fde21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions res/layouts/console.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
</container>

<container id="logContainer" pos="0,60"
size-func="unpack(vec2.add(gui.get_viewport(), {0,-100}))">
size-func="unpack(vec2.add(gui.get_viewport(), {-350,-100}))">
<textbox
id='log'
color='0'
autoresize='true'
margin='0'
editable='false'
multiline='true'
size-func="gui.get_viewport()[1],40"
size-func="gui.get_viewport()[1]-350,40"
gravity="bottom-left"
markup="md"
></textbox>
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/ui/elements/TextBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)+2;
int realoffset = font->calcWidth(input, lcaret)-int(textOffset) - padding.x;
if (realoffset-width > 0) {
setTextOffset(textOffset + realoffset-width);
} else if (realoffset < 0) {
Expand Down

0 comments on commit 13fde21

Please sign in to comment.