mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Fix mouse wheel on NotificationsScroll (#9451)
* Fix mouse wheel on NotificationsScroll * Explain why getMouseWheelX is overridden to zero
This commit is contained in:
parent
268d27d1ed
commit
c73d5d74d0
@ -110,6 +110,16 @@ class NotificationsScroll(
|
|||||||
height = worldScreen.stage.height * inverseScaleFactor
|
height = worldScreen.stage.height * inverseScaleFactor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a Gdx ScrollPane has content larger than its size on both dimensions (if only one axis is
|
||||||
|
* scrollable, the wheel will always scroll that axis), it will prefer mapping the mouse wheel
|
||||||
|
* to *horizontal* scrolling, which is not quite the best choice for our notifications.
|
||||||
|
*
|
||||||
|
* The intuitive approach might be to change the listener (by overriding [addScrollListener]),
|
||||||
|
* but luckily this works too.
|
||||||
|
*/
|
||||||
|
override fun getMouseWheelX() = 0f
|
||||||
|
|
||||||
/** Access to hidden "state" - writing it will ensure this is fully visible or hidden and the
|
/** Access to hidden "state" - writing it will ensure this is fully visible or hidden and the
|
||||||
* restore button shown as needed - with animation. */
|
* restore button shown as needed - with animation. */
|
||||||
@Suppress("MemberVisibilityCanBePrivate") // API for future use
|
@Suppress("MemberVisibilityCanBePrivate") // API for future use
|
||||||
|
Loading…
x
Reference in New Issue
Block a user