aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshivajiva101 <shivajiva101@hotmail.com>2017-11-18 13:58:08 +0000
committerSmallJoker <SmallJoker@users.noreply.github.com>2017-11-18 14:58:08 +0100
commit3f8e2e8c38c8f4fc2ba5d044ef445123db454d99 (patch)
treef05a7a228ec6047c5047d2e055092c3e6df9ec17
parent0780ee51c50235a462e47f4a4385cefcf1b48330 (diff)
downloadminetest-3f8e2e8c38c8f4fc2ba5d044ef445123db454d99.tar.gz
minetest-3f8e2e8c38c8f4fc2ba5d044ef445123db454d99.tar.bz2
minetest-3f8e2e8c38c8f4fc2ba5d044ef445123db454d99.zip
Fix mousewheel behaviour in textarea (#6641)
Allowing scrolling with the mousewheel when the vertical scrollbar is hidden, unnecessarily exposes oversized containers and newlines at the end of the text. For example try scrolling over the textareas in the pause menu. This PR addresses the issue by requiring the scrollbar to be visible before allowing the scrolling with the mousewheel.
-rw-r--r--src/gui/intlGUIEditBox.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/intlGUIEditBox.cpp b/src/gui/intlGUIEditBox.cpp
index 279e7a48a..c03256ede 100644
--- a/src/gui/intlGUIEditBox.cpp
+++ b/src/gui/intlGUIEditBox.cpp
@@ -1087,7 +1087,7 @@ bool intlGUIEditBox::processMouse(const SEvent& event)
}
break;
case EMIE_MOUSE_WHEEL:
- if (m_vscrollbar) {
+ if (m_vscrollbar && m_vscrollbar->isVisible()) {
s32 pos = m_vscrollbar->getPos();
s32 step = m_vscrollbar->getSmallStep();
m_vscrollbar->setPos(pos - event.MouseInput.Wheel * step);