mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Fix mouse wheel on NotificationsScroll (#9451)
* Fix mouse wheel on NotificationsScroll * Explain why getMouseWheelX is overridden to zero
This commit is contained in:
@ -110,6 +110,16 @@ class NotificationsScroll(
|
||||
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
|
||||
* restore button shown as needed - with animation. */
|
||||
@Suppress("MemberVisibilityCanBePrivate") // API for future use
|
||||
|
Reference in New Issue
Block a user