From f018b78f8326b16d10b741fe6d8e18a4c2238c5f Mon Sep 17 00:00:00 2001 From: yairm210 Date: Wed, 11 Dec 2024 11:55:53 +0200 Subject: [PATCH] Fixed scroll position indicator --- .../com/unciv/ui/screens/worldscreen/minimap/Minimap.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/screens/worldscreen/minimap/Minimap.kt b/core/src/com/unciv/ui/screens/worldscreen/minimap/Minimap.kt index 0348811c9f..4daf0f7c4f 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/minimap/Minimap.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/minimap/Minimap.kt @@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.g2d.Batch import com.badlogic.gdx.math.Rectangle import com.badlogic.gdx.math.Vector2 import com.badlogic.gdx.scenes.scene2d.Actor +import com.badlogic.gdx.scenes.scene2d.Group import com.badlogic.gdx.scenes.scene2d.Touchable import com.unciv.logic.civilization.Civilization import com.unciv.logic.map.MapShape @@ -58,12 +59,16 @@ class Minimap(val mapHolder: WorldMapHolder, minimapSize: Int, private val civIn group.moveBy(padX, padY) } - scrollPositionIndicators = createScrollPositionIndicators() - scrollPositionIndicators.forEach(tileLayer::addActor) addActor(tileLayer) addActor(borderLayer) addActor(cityLayer) + + val scrollIndicatorLayer = Group() + scrollIndicatorLayer.setSize(width, height) + scrollPositionIndicators = createScrollPositionIndicators() + scrollPositionIndicators.forEach(scrollIndicatorLayer::addActor) + addActor(scrollIndicatorLayer) mapHolder.onViewportChangedListener = ::updateScrollPosition }