Skip to content

Commit

Permalink
Fix mousewheel behaviour in textarea (#6641)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shivajiva101 authored and SmallJoker committed Nov 18, 2017
1 parent 0780ee5 commit 3f8e2e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/intlGUIEditBox.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 3f8e2e8

Please sign in to comment.