From f066026503b4f50377fe3eca5ee55f1261ff00f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 6 May 2024 11:55:49 +0200 Subject: [PATCH] Fix sizing of gameplay preview in skin editor not updating on scaling mode change Closes https://github.com/ppy/osu/issues/28115. --- osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs index 2f4820e207..748e9c6c0b 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Input; using osu.Framework.Input.Bindings; using osu.Framework.Input.Events; +using osu.Framework.Layout; using osu.Framework.Screens; using osu.Framework.Testing; using osu.Game.Beatmaps; @@ -30,7 +31,6 @@ using osu.Game.Screens.Play; using osu.Game.Screens.Select; using osu.Game.Users; using osu.Game.Utils; -using osuTK; namespace osu.Game.Overlays.SkinEditor { @@ -70,12 +70,14 @@ namespace osu.Game.Overlays.SkinEditor private OsuScreen? lastTargetScreen; private InvokeOnDisposal? nestedInputManagerDisable; - private Vector2 lastDrawSize; + private LayoutValue drawSizeLayout; public SkinEditorOverlay(ScalingContainer scalingContainer) { this.scalingContainer = scalingContainer; RelativeSizeAxes = Axes.Both; + + AddLayout(drawSizeLayout = new LayoutValue(Invalidation.DrawSize)); } [BackgroundDependencyLoader] @@ -199,10 +201,10 @@ namespace osu.Game.Overlays.SkinEditor { base.Update(); - if (game.DrawSize != lastDrawSize) + if (!drawSizeLayout.IsValid) { - lastDrawSize = game.DrawSize; updateScreenSizing(); + drawSizeLayout.Validate(); } }