Skip to content

Commit

Permalink
Fix scroll bar overlapping text (again) (#9058)
Browse files Browse the repository at this point in the history
  • Loading branch information
random-geek committed Oct 3, 2020
1 parent 9dc29a7 commit 0750047
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/gui/guiEditBoxWithScrollbar.cpp
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions src/gui/intlGUIEditBox.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0750047

Please sign in to comment.