mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 15:03:12 +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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Configuration;
|
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.
|
// todo: can probably make this better via deserialisation directly using a common interface.
|
||||||
component.Position = drawableInfo.Position;
|
component.Position = drawableInfo.Position;
|
||||||
component.Rotation = drawableInfo.Rotation;
|
component.Rotation = drawableInfo.Rotation;
|
||||||
if (drawableInfo.Size != Vector2.Zero && (component as CompositeDrawable)?.AutoSizeAxes == Axes.None)
|
if (drawableInfo.Width is float width && width != 0 && (component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.X) == false)
|
||||||
component.Size = drawableInfo.Size;
|
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.Scale = drawableInfo.Scale;
|
||||||
component.Anchor = drawableInfo.Anchor;
|
component.Anchor = drawableInfo.Anchor;
|
||||||
component.Origin = drawableInfo.Origin;
|
component.Origin = drawableInfo.Origin;
|
||||||
|
@ -35,7 +35,9 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
public Vector2 Scale { get; set; }
|
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; }
|
public Anchor Anchor { get; set; }
|
||||||
|
|
||||||
@ -64,7 +66,8 @@ namespace osu.Game.Skinning
|
|||||||
Position = component.Position;
|
Position = component.Position;
|
||||||
Rotation = component.Rotation;
|
Rotation = component.Rotation;
|
||||||
Scale = component.Scale;
|
Scale = component.Scale;
|
||||||
Size = component.Size;
|
Height = component.Height;
|
||||||
|
Width = component.Width;
|
||||||
Anchor = component.Anchor;
|
Anchor = component.Anchor;
|
||||||
Origin = component.Origin;
|
Origin = component.Origin;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user