mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 15:12:23 +01:00
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.
This commit is contained in:
parent
0780ee51c5
commit
3f8e2e8c38
@ -1087,7 +1087,7 @@ bool intlGUIEditBox::processMouse(const SEvent& event)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EMIE_MOUSE_WHEEL:
|
case EMIE_MOUSE_WHEEL:
|
||||||
if (m_vscrollbar) {
|
if (m_vscrollbar && m_vscrollbar->isVisible()) {
|
||||||
s32 pos = m_vscrollbar->getPos();
|
s32 pos = m_vscrollbar->getPos();
|
||||||
s32 step = m_vscrollbar->getSmallStep();
|
s32 step = m_vscrollbar->getSmallStep();
|
||||||
m_vscrollbar->setPos(pos - event.MouseInput.Wheel * step);
|
m_vscrollbar->setPos(pos - event.MouseInput.Wheel * step);
|
||||||
|
Loading…
Reference in New Issue
Block a user