diff --git a/core/src/com/unciv/ui/screens/worldscreen/NotificationsScroll.kt b/core/src/com/unciv/ui/screens/worldscreen/NotificationsScroll.kt index 2d04660de6..7028d0c351 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/NotificationsScroll.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/NotificationsScroll.kt @@ -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