aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorrandom-geek <35757396+random-geek@users.noreply.github.com>2020-10-03 09:34:34 -0700
committerGitHub <noreply@github.com>2020-10-03 17:34:34 +0100
commit07500479191ed927ab661b3758ffcd2fd43158c5 (patch)
tree8746b903b74df7397cecf01da26670077616547a /src/gui
parent9dc29a75b416c6dab27ce93d0129383309cbf2c2 (diff)
downloadminetest-07500479191ed927ab661b3758ffcd2fd43158c5.tar.gz
minetest-07500479191ed927ab661b3758ffcd2fd43158c5.tar.bz2
minetest-07500479191ed927ab661b3758ffcd2fd43158c5.zip
Fix scroll bar overlapping text (again) (#9058)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/guiEditBoxWithScrollbar.cpp4
-rw-r--r--src/gui/intlGUIEditBox.cpp4
2 files changed, 2 insertions, 6 deletions
diff --git a/src/gui/guiEditBoxWithScrollbar.cpp b/src/gui/guiEditBoxWithScrollbar.cpp
index 442406688..169425a9a 100644
--- a/src/gui/guiEditBoxWithScrollbar.cpp
+++ b/src/gui/guiEditBoxWithScrollbar.cpp
@@ -1028,7 +1028,7 @@ void GUIEditBoxWithScrollBar::breakText()
s32 last_line_start = 0;
s32 size = Text.size();
s32 length = 0;
- s32 el_width = RelativeRect.getWidth() - 6;
+ s32 el_width = RelativeRect.getWidth() - m_scrollbar_width - 10;
wchar_t c;
for (s32 i = 0; i < size; ++i) {
@@ -1399,8 +1399,6 @@ void GUIEditBoxWithScrollBar::createVScrollBar()
m_scrollbar_width = skin ? skin->getSize(gui::EGDS_SCROLLBAR_SIZE) : 16;
- RelativeRect.LowerRightCorner.X -= m_scrollbar_width + 4;
-
irr::core::rect<s32> scrollbarrect = m_frame_rect;
scrollbarrect.UpperLeftCorner.X += m_frame_rect.getWidth() - m_scrollbar_width;
m_vscrollbar = new GUIScrollBar(Environment, getParent(), -1,
diff --git a/src/gui/intlGUIEditBox.cpp b/src/gui/intlGUIEditBox.cpp
index 10395423c..8be63fd6f 100644
--- a/src/gui/intlGUIEditBox.cpp
+++ b/src/gui/intlGUIEditBox.cpp
@@ -1165,7 +1165,7 @@ void intlGUIEditBox::breakText()
s32 lastLineStart = 0;
s32 size = Text.size();
s32 length = 0;
- s32 elWidth = RelativeRect.getWidth() - 6;
+ s32 elWidth = RelativeRect.getWidth() - m_scrollbar_width - 10;
wchar_t c;
for (s32 i=0; i<size; ++i)
@@ -1478,8 +1478,6 @@ void intlGUIEditBox::createVScrollBar()
}
}
- RelativeRect.LowerRightCorner.X -= m_scrollbar_width + 4;
-
irr::core::rect<s32> scrollbarrect = FrameRect;
scrollbarrect.UpperLeftCorner.X += FrameRect.getWidth() - m_scrollbar_width;
m_vscrollbar = new GUIScrollBar(Environment, getParent(), -1,