Flip comparison to allow non-composite drawables to still get resized

This commit is contained in:
Dean Herbert 2023-11-10 20:00:20 +09:00
parent b7acbde719
commit 57cd5194ce
No known key found for this signature in database

View File

@ -19,9 +19,9 @@ 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.Width is float width && width != 0 && (component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.X) == false)
if (drawableInfo.Width is float width && width != 0 && (component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.X) != true)
component.Width = width;
if (drawableInfo.Height is float height && height != 0 && (component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.Y) == false)
if (drawableInfo.Height is float height && height != 0 && (component as CompositeDrawable)?.AutoSizeAxes.HasFlagFast(Axes.Y) != true)
component.Height = height;
component.Scale = drawableInfo.Scale;
component.Anchor = drawableInfo.Anchor;