mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Merge pull request #28118 from bdach/scaling-mode-does-not-affect-skin-editor
Fix sizing of gameplay preview in skin editor not updating on scaling mode change
This commit is contained in:
commit
29eef26a69
@ -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 readonly 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user