mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Resolved #2611 - City button shrinks on zoom in, showing the 'hidden' unit icons behind it
This commit is contained in:
parent
de337a0ca2
commit
54dd7e5d62
@ -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 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) }
|
val circleCrosshairFogLayerGroup = Group().apply { isTransform = false; setSize(groupSize, groupSize) }
|
||||||
private val circleImage = ImageGetter.getCircle() // for blue and red circles on the tile
|
private val circleImage = ImageGetter.getCircle() // for blue and red circles on the tile
|
||||||
|
@ -16,7 +16,7 @@ open class ZoomableScrollPane: ScrollPane(null) {
|
|||||||
addZoomListeners()
|
addZoomListeners()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun zoom(zoomScale: Float) {
|
open fun zoom(zoomScale: Float) {
|
||||||
if (zoomScale < 0.5f || zoomScale > 10) return
|
if (zoomScale < 0.5f || zoomScale > 10) return
|
||||||
setScale(zoomScale)
|
setScale(zoomScale)
|
||||||
}
|
}
|
||||||
|
@ -347,4 +347,12 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
|||||||
|
|
||||||
worldScreen.shouldUpdate=true
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user