Only store width/height of serialised drawable if it isn't automatically computed

This commit is contained in:
Bartłomiej Dach 2023-11-10 19:12:26 +09:00
parent ec2200d54f
commit b7acbde719
No known key found for this signature in database
1 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@
using System.Linq;
using Newtonsoft.Json;
using osu.Framework.Bindables;
using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
@ -66,8 +67,13 @@ public SerialisedDrawableInfo(Drawable component)
Position = component.Position;
Rotation = component.Rotation;
Scale = component.Scale;
Height = component.Height;
Width = component.Width;
if ((component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.X) != true)
Width = component.Width;
if ((component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.Y) != true)
Height = component.Height;
Anchor = component.Anchor;
Origin = component.Origin;