diff --git a/core/src/com/unciv/ui/tilegroups/TileGroup.kt b/core/src/com/unciv/ui/tilegroups/TileGroup.kt index 2dd60598..a4bbe2ea 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroup.kt @@ -67,7 +67,8 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings) val unitLayerGroup = Group().apply { isTransform = false; setSize(groupSize, groupSize);touchable = Touchable.disabled } - val cityButtonLayerGroup = Group().apply { isTransform = true; setSize(groupSize, groupSize);touchable = Touchable.childrenOnly } + val cityButtonLayerGroup = Group().apply { isTransform = true; setSize(groupSize, groupSize); + touchable = Touchable.childrenOnly; setOrigin(Align.center) } val circleCrosshairFogLayerGroup = Group().apply { isTransform = false; setSize(groupSize, groupSize) } private val circleImage = ImageGetter.getCircle() // for blue and red circles on the tile diff --git a/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt b/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt index 8211fe15..5e396aad 100644 --- a/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt +++ b/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt @@ -16,7 +16,7 @@ open class ZoomableScrollPane: ScrollPane(null) { addZoomListeners() } - fun zoom(zoomScale: Float) { + open fun zoom(zoomScale: Float) { if (zoomScale < 0.5f || zoomScale > 10) return setScale(zoomScale) } diff --git a/core/src/com/unciv/ui/worldscreen/WorldMapHolder.kt b/core/src/com/unciv/ui/worldscreen/WorldMapHolder.kt index be5b5d74..3d8a8de6 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldMapHolder.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldMapHolder.kt @@ -347,4 +347,12 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap worldScreen.shouldUpdate=true } + + override fun zoom(zoomScale:Float){ + super.zoom(zoomScale) + val scale = 1/scaleX // don't use zoomScale itself, in case it was out of bounds and not applied + if(scale < 1 && scale > 0.5f) + for(tileGroup in tileGroups.values) + tileGroup.cityButtonLayerGroup.setScale(scale) + } } \ No newline at end of file