Fix GUIEditBoxWithScrollBar using a smaller steps than intlGUIEditBox (#11519)

This commit is contained in:
DS 2021-08-08 18:59:45 +02:00 committed by GitHub
parent c6eddb0bae
commit 1ab29f1716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

@ -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<s32> 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);
}

@ -192,8 +192,6 @@ src/gui/guiTable.cpp
src/gui/guiTable.h
src/gui/guiVolumeChange.cpp
src/gui/guiVolumeChange.h
src/gui/intlGUIEditBox.cpp
src/gui/intlGUIEditBox.h
src/gui/mainmenumanager.h
src/gui/modalMenu.h
src/guiscalingfilter.cpp