mirror of https://github.com/ppy/osu
Add `Size` to serialised components of a `SerialisedDrawableInfo`
This commit is contained in:
parent
1a8636638d
commit
b0c5b3cb10
|
@ -6,6 +6,7 @@
|
|||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Extensions;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
|
@ -18,6 +19,8 @@ public static void ApplySerialisedInfo(this Drawable component, SerialisedDrawab
|
|||
// 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;
|
||||
component.Scale = drawableInfo.Scale;
|
||||
component.Anchor = drawableInfo.Anchor;
|
||||
component.Origin = drawableInfo.Origin;
|
||||
|
|
|
@ -35,6 +35,8 @@ public sealed class SerialisedDrawableInfo
|
|||
|
||||
public Vector2 Scale { get; set; }
|
||||
|
||||
public Vector2 Size { get; set; }
|
||||
|
||||
public Anchor Anchor { get; set; }
|
||||
|
||||
public Anchor Origin { get; set; }
|
||||
|
@ -62,6 +64,7 @@ public SerialisedDrawableInfo(Drawable component)
|
|||
Position = component.Position;
|
||||
Rotation = component.Rotation;
|
||||
Scale = component.Scale;
|
||||
Size = component.Size;
|
||||
Anchor = component.Anchor;
|
||||
Origin = component.Origin;
|
||||
|
||||
|
|
Loading…
Reference in New Issue