mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 02:22:57 +08:00
don't allow negative scaling
This commit is contained in:
parent
cb23f03d4b
commit
d2798c7a1c
@ -71,6 +71,9 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
scale.Y = scale.X / selectionRect.Width * selectionRect.Height;
|
scale.Y = scale.X / selectionRect.Width * selectionRect.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If scaling reverses the selection, don't scale.
|
||||||
|
if (adjustedRect.Width + scale.X < 0 || adjustedRect.Height + scale.Y < 0) return true;
|
||||||
|
|
||||||
if (anchor.HasFlagFast(Anchor.x0)) adjustedRect.X -= scale.X;
|
if (anchor.HasFlagFast(Anchor.x0)) adjustedRect.X -= scale.X;
|
||||||
if (anchor.HasFlagFast(Anchor.y0)) adjustedRect.Y -= scale.Y;
|
if (anchor.HasFlagFast(Anchor.y0)) adjustedRect.Y -= scale.Y;
|
||||||
|
|
||||||
@ -79,8 +82,8 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
// scale adjust applied to each individual item should match that of the quad itself.
|
// scale adjust applied to each individual item should match that of the quad itself.
|
||||||
var scaledDelta = new Vector2(
|
var scaledDelta = new Vector2(
|
||||||
MathF.Max(adjustedRect.Width / selectionRect.Width, 0),
|
adjustedRect.Width / selectionRect.Width,
|
||||||
MathF.Max(adjustedRect.Height / selectionRect.Height, 0)
|
adjustedRect.Height / selectionRect.Height
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach (var b in SelectedBlueprints)
|
foreach (var b in SelectedBlueprints)
|
||||||
|
Loading…
Reference in New Issue
Block a user