1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

Fix sizing of gameplay preview in skin editor not updating on scaling mode change

Closes https://github.com/ppy/osu/issues/28115.
This commit is contained in:
Bartłomiej Dach 2024-05-06 11:55:49 +02:00
parent 761d713593
commit f066026503
No known key found for this signature in database

View File

@ -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();
}
}