From 77888be8d6da0950cfc99ef7aa9cc7a4b8653ba7 Mon Sep 17 00:00:00 2001 From: vegeta1k95 <32207817+vegeta1k95@users.noreply.github.com> Date: Mon, 6 Feb 2023 22:47:28 +0100 Subject: [PATCH] Fix MapEditor world-wrap flickering (#8608) Co-authored-by: tunerzinc@gmail.com --- core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt | 5 +++++ core/src/com/unciv/ui/utils/ZoomableScrollPane.kt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt b/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt index 75c16912b4..3c65c700fe 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt @@ -134,6 +134,11 @@ class MapEditorScreen(map: TileMap? = null): BaseScreen(), RecreateOnResize { tileClickHandler?.invoke(it) } + if (tileMap.mapParameters.worldWrap) { + result.sizeChanged() + result.zoom(result.minZoom) + } + stage.root.addActorAt(0, result) stage.scrollFocus = result diff --git a/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt b/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt index 26599f99bf..0c56bd317f 100644 --- a/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt +++ b/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt @@ -82,7 +82,7 @@ open class ZoomableScrollPane( onViewportChanged() } - override fun sizeChanged() { + public override fun sizeChanged() { updatePadding() super.sizeChanged() updateCulling()