From 1ab29f1716e51bccd405e6f6e04bad64712cc018 Mon Sep 17 00:00:00 2001 From: DS Date: Sun, 8 Aug 2021 18:59:45 +0200 Subject: Fix GUIEditBoxWithScrollBar using a smaller steps than intlGUIEditBox (#11519) --- src/gui/guiEditBoxWithScrollbar.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/guiEditBoxWithScrollbar.cpp b/src/gui/guiEditBoxWithScrollbar.cpp index c72070787..fb4bc2a0b 100644 --- a/src/gui/guiEditBoxWithScrollbar.cpp +++ b/src/gui/guiEditBoxWithScrollbar.cpp @@ -620,6 +620,17 @@ void GUIEditBoxWithScrollBar::createVScrollBar() if (Environment) skin = Environment->getSkin(); + s32 fontHeight = 1; + + if (m_override_font) { + fontHeight = m_override_font->getDimension(L"Ay").Height; + } else { + IGUIFont *font; + if (skin && (font = skin->getFont())) { + fontHeight = font->getDimension(L"Ay").Height; + } + } + m_scrollbar_width = skin ? skin->getSize(gui::EGDS_SCROLLBAR_SIZE) : 16; irr::core::rect scrollbarrect = m_frame_rect; @@ -628,8 +639,8 @@ void GUIEditBoxWithScrollBar::createVScrollBar() scrollbarrect, false, true); m_vscrollbar->setVisible(false); - m_vscrollbar->setSmallStep(1); - m_vscrollbar->setLargeStep(1); + m_vscrollbar->setSmallStep(3 * fontHeight); + m_vscrollbar->setLargeStep(10 * fontHeight); } -- cgit v1.2.3