1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:03:13 +08:00

Add Size to serialised components of a SerialisedDrawableInfo

This commit is contained in:
Dean Herbert 2023-11-10 14:15:42 +09:00
parent 1a8636638d
commit b0c5b3cb10
No known key found for this signature in database
2 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Extensions; using osu.Game.Extensions;
using osuTK;
namespace osu.Game.Skinning namespace osu.Game.Skinning
{ {
@ -18,6 +19,8 @@ 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)
component.Size = drawableInfo.Size;
component.Scale = drawableInfo.Scale; component.Scale = drawableInfo.Scale;
component.Anchor = drawableInfo.Anchor; component.Anchor = drawableInfo.Anchor;
component.Origin = drawableInfo.Origin; component.Origin = drawableInfo.Origin;

View File

@ -35,6 +35,8 @@ namespace osu.Game.Skinning
public Vector2 Scale { get; set; } public Vector2 Scale { get; set; }
public Vector2 Size { get; set; }
public Anchor Anchor { get; set; } public Anchor Anchor { get; set; }
public Anchor Origin { get; set; } public Anchor Origin { get; set; }
@ -62,6 +64,7 @@ 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;
Anchor = component.Anchor; Anchor = component.Anchor;
Origin = component.Origin; Origin = component.Origin;