mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Fix test failures due to fluctuations in needlessly-serialised automatic sizings
This commit is contained in:
parent
35e11c7c63
commit
2c1f304f3b
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.EnumExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Configuration;
|
||||
@ -19,8 +20,10 @@ namespace osu.Game.Skinning
|
||||
// todo: can probably make this better via deserialisation directly using a common interface.
|
||||
component.Position = drawableInfo.Position;
|
||||
component.Rotation = drawableInfo.Rotation;
|
||||
if (drawableInfo.Size != Vector2.Zero && (component as CompositeDrawable)?.AutoSizeAxes == Axes.None)
|
||||
component.Size = drawableInfo.Size;
|
||||
if (drawableInfo.Width is float width && width != 0 && (component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.X) == false)
|
||||
component.Width = width;
|
||||
if (drawableInfo.Height is float height && height != 0 && (component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.Y) == false)
|
||||
component.Height = height;
|
||||
component.Scale = drawableInfo.Scale;
|
||||
component.Anchor = drawableInfo.Anchor;
|
||||
component.Origin = drawableInfo.Origin;
|
||||
|
@ -35,7 +35,9 @@ namespace osu.Game.Skinning
|
||||
|
||||
public Vector2 Scale { get; set; }
|
||||
|
||||
public Vector2 Size { get; set; }
|
||||
public float? Width { get; set; }
|
||||
|
||||
public float? Height { get; set; }
|
||||
|
||||
public Anchor Anchor { get; set; }
|
||||
|
||||
@ -64,7 +66,8 @@ namespace osu.Game.Skinning
|
||||
Position = component.Position;
|
||||
Rotation = component.Rotation;
|
||||
Scale = component.Scale;
|
||||
Size = component.Size;
|
||||
Height = component.Height;
|
||||
Width = component.Width;
|
||||
Anchor = component.Anchor;
|
||||
Origin = component.Origin;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user