aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2021-08-08 18:59:45 +0200
committerGitHub <noreply@github.com>2021-08-08 18:59:45 +0200
commit1ab29f1716e51bccd405e6f6e04bad64712cc018 (patch)
treeb986746e3a2c30673423eef05f6d7bbd35c99e85
parentc6eddb0bae32c43ffff46e9c1e3f293d0fd9ed73 (diff)
downloadminetest-1ab29f1716e51bccd405e6f6e04bad64712cc018.tar.gz
minetest-1ab29f1716e51bccd405e6f6e04bad64712cc018.tar.bz2
minetest-1ab29f1716e51bccd405e6f6e04bad64712cc018.zip
Fix GUIEditBoxWithScrollBar using a smaller steps than intlGUIEditBox (#11519)
-rw-r--r--src/gui/guiEditBoxWithScrollbar.cpp15
-rw-r--r--util/ci/clang-format-whitelist.txt2
2 files changed, 13 insertions, 4 deletions
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<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);
}
diff --git a/util/ci/clang-format-whitelist.txt b/util/ci/clang-format-whitelist.txt
index 75d99f4cd..5cbc262ef 100644
--- a/util/ci/clang-format-whitelist.txt
+++ b/util/ci/clang-format-whitelist.txt
@@ -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