From f613bba7d4fe2301a93efae83915f7355d7b587b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 29 May 2022 00:07:07 +0300 Subject: [PATCH] Better minimap buttons --- .../unciv/ui/worldscreen/minimap/MapOverlayToggleButton.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/ui/worldscreen/minimap/MapOverlayToggleButton.kt b/core/src/com/unciv/ui/worldscreen/minimap/MapOverlayToggleButton.kt index 950233deac..01fdc529e3 100644 --- a/core/src/com/unciv/ui/worldscreen/minimap/MapOverlayToggleButton.kt +++ b/core/src/com/unciv/ui/worldscreen/minimap/MapOverlayToggleButton.kt @@ -25,13 +25,14 @@ class MapOverlayToggleButton( /** [Actor] of the button. Add this to whatever layout. */ val actor: IconCircleGroup by lazy { var innerActor: Actor = icon + val iconSize = 30f if (backgroundColor != null) { innerActor = innerActor - .surroundWithCircle(30f) + .surroundWithCircle(iconSize) .apply { circle.color = backgroundColor } - } + } else innerActor.setSize(iconSize,iconSize) // So, the "Food" and "Population" stat icons have green as part of their image, but the "Cattle" icon needs a background colour, which is… An interesting mixture/reuse of texture data and render-time processing. - innerActor.surroundWithCircle(40f).apply { circle.color = Color.BLACK } + innerActor.surroundWithCircle(32f, resizeActor = false).apply { circle.color = Color.BLACK } } init {