2021-04-28 06:14:48 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2021-05-14 07:03:22 +00:00
|
|
|
using osu.Framework.Allocation;
|
2021-05-13 08:51:57 +00:00
|
|
|
using osu.Framework.Extensions.EnumExtensions;
|
2021-04-28 06:14:48 +00:00
|
|
|
using osu.Framework.Graphics;
|
2021-05-20 09:24:25 +00:00
|
|
|
using osu.Framework.Graphics.Primitives;
|
2021-04-28 06:14:48 +00:00
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2021-05-21 06:02:36 +00:00
|
|
|
using osu.Framework.Utils;
|
2021-04-29 06:29:25 +00:00
|
|
|
using osu.Game.Extensions;
|
2021-04-28 06:14:48 +00:00
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
using osu.Game.Rulesets.Edit;
|
|
|
|
using osu.Game.Screens.Edit.Compose.Components;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Skinning.Editor
|
|
|
|
{
|
2021-05-13 08:06:00 +00:00
|
|
|
public class SkinSelectionHandler : SelectionHandler<ISkinnableDrawable>
|
2021-04-28 06:14:48 +00:00
|
|
|
{
|
2021-05-14 07:03:22 +00:00
|
|
|
[Resolved]
|
|
|
|
private SkinEditor skinEditor { get; set; }
|
|
|
|
|
2021-05-03 06:15:00 +00:00
|
|
|
public override bool HandleRotation(float angle)
|
|
|
|
{
|
2021-05-20 09:21:16 +00:00
|
|
|
if (SelectedBlueprints.Count == 1)
|
|
|
|
{
|
|
|
|
// for single items, rotate around the origin rather than the selection centre.
|
|
|
|
((Drawable)SelectedBlueprints.First().Item).Rotation += angle;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-05-20 09:24:25 +00:00
|
|
|
var selectionQuad = getSelectionQuad();
|
2021-05-20 09:21:16 +00:00
|
|
|
|
|
|
|
foreach (var b in SelectedBlueprints)
|
|
|
|
{
|
|
|
|
var drawableItem = (Drawable)b.Item;
|
|
|
|
|
2021-05-22 12:17:58 +00:00
|
|
|
var rotatedPosition = RotatePointAroundOrigin(b.ScreenSpaceSelectionPoint, selectionQuad.Centre, angle);
|
2021-05-20 09:35:13 +00:00
|
|
|
updateDrawablePosition(drawableItem, rotatedPosition);
|
2021-05-22 12:17:58 +00:00
|
|
|
|
2021-05-20 09:21:16 +00:00
|
|
|
drawableItem.Rotation += angle;
|
|
|
|
}
|
|
|
|
}
|
2021-05-03 06:15:00 +00:00
|
|
|
|
2021-05-20 09:21:16 +00:00
|
|
|
// this isn't always the case but let's be lenient for now.
|
|
|
|
return true;
|
2021-05-03 06:15:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public override bool HandleScale(Vector2 scale, Anchor anchor)
|
|
|
|
{
|
2021-05-19 16:47:31 +00:00
|
|
|
// convert scale to screen space
|
|
|
|
scale = ToScreenSpace(scale) - ToScreenSpace(Vector2.Zero);
|
|
|
|
|
2021-05-03 06:15:00 +00:00
|
|
|
adjustScaleFromAnchor(ref scale, anchor);
|
|
|
|
|
2021-05-21 06:02:36 +00:00
|
|
|
// the selection quad is always upright, so use an AABB rect to make mutating the values easier.
|
2021-05-22 11:52:28 +00:00
|
|
|
var selectionRect = getSelectionQuad().AABBFloat;
|
2021-05-19 12:46:41 +00:00
|
|
|
|
2021-05-24 19:36:42 +00:00
|
|
|
// If the selection has no area we cannot scale it
|
2021-05-26 06:20:47 +00:00
|
|
|
if (selectionRect.Area == 0)
|
2021-05-24 19:36:42 +00:00
|
|
|
return false;
|
|
|
|
|
2021-05-21 06:02:36 +00:00
|
|
|
// copy to mutate, as we will need to compare to the original later on.
|
|
|
|
var adjustedRect = selectionRect;
|
2021-05-19 12:46:41 +00:00
|
|
|
|
2021-05-21 06:02:36 +00:00
|
|
|
// first, remove any scale axis we are not interested in.
|
|
|
|
if (anchor.HasFlagFast(Anchor.x1)) scale.X = 0;
|
|
|
|
if (anchor.HasFlagFast(Anchor.y1)) scale.Y = 0;
|
2021-05-19 12:46:41 +00:00
|
|
|
|
2021-11-04 21:10:41 +00:00
|
|
|
// for now aspect lock scale adjustments that occur at corners..
|
|
|
|
if (!anchor.HasFlagFast(Anchor.x1) && !anchor.HasFlagFast(Anchor.y1))
|
|
|
|
{
|
|
|
|
// project scale vector along diagonal
|
|
|
|
Vector2 diag = (selectionRect.TopLeft - selectionRect.BottomRight).Normalized();
|
|
|
|
scale = Vector2.Dot(scale, diag) * diag;
|
|
|
|
}
|
|
|
|
// ..or if any of the selection have been rotated.
|
|
|
|
// this is to avoid requiring skew logic (which would likely not be the user's expected transform anyway).
|
|
|
|
else if (SelectedBlueprints.Any(b => !Precision.AlmostEquals(((Drawable)b.Item).Rotation, 0)))
|
2021-05-19 12:46:41 +00:00
|
|
|
{
|
2021-05-21 06:02:36 +00:00
|
|
|
if (anchor.HasFlagFast(Anchor.x1))
|
|
|
|
// if dragging from the horizontal centre, only a vertical component is available.
|
|
|
|
scale.X = scale.Y / selectionRect.Height * selectionRect.Width;
|
|
|
|
else
|
|
|
|
// in all other cases (arbitrarily) use the horizontal component for aspect lock.
|
|
|
|
scale.Y = scale.X / selectionRect.Width * selectionRect.Height;
|
2021-05-19 12:46:41 +00:00
|
|
|
}
|
2021-05-19 10:58:55 +00:00
|
|
|
|
2021-05-21 06:02:36 +00:00
|
|
|
if (anchor.HasFlagFast(Anchor.x0)) adjustedRect.X -= scale.X;
|
|
|
|
if (anchor.HasFlagFast(Anchor.y0)) adjustedRect.Y -= scale.Y;
|
|
|
|
|
|
|
|
adjustedRect.Width += scale.X;
|
|
|
|
adjustedRect.Height += scale.Y;
|
|
|
|
|
|
|
|
// scale adjust applied to each individual item should match that of the quad itself.
|
2021-05-19 12:46:41 +00:00
|
|
|
var scaledDelta = new Vector2(
|
2021-06-08 15:49:25 +00:00
|
|
|
MathF.Max(adjustedRect.Width / selectionRect.Width, 0),
|
|
|
|
MathF.Max(adjustedRect.Height / selectionRect.Height, 0)
|
2021-05-19 12:46:41 +00:00
|
|
|
);
|
2021-05-19 10:58:55 +00:00
|
|
|
|
2021-05-19 12:46:41 +00:00
|
|
|
foreach (var b in SelectedBlueprints)
|
|
|
|
{
|
|
|
|
var drawableItem = (Drawable)b.Item;
|
|
|
|
|
|
|
|
// each drawable's relative position should be maintained in the scaled quad.
|
|
|
|
var screenPosition = b.ScreenSpaceSelectionPoint;
|
2021-05-19 10:58:55 +00:00
|
|
|
|
2021-05-19 12:46:41 +00:00
|
|
|
var relativePositionInOriginal =
|
|
|
|
new Vector2(
|
2021-05-21 06:02:36 +00:00
|
|
|
(screenPosition.X - selectionRect.TopLeft.X) / selectionRect.Width,
|
|
|
|
(screenPosition.Y - selectionRect.TopLeft.Y) / selectionRect.Height
|
2021-05-19 12:46:41 +00:00
|
|
|
);
|
2021-05-19 10:58:55 +00:00
|
|
|
|
2021-05-19 12:46:41 +00:00
|
|
|
var newPositionInAdjusted = new Vector2(
|
|
|
|
adjustedRect.TopLeft.X + adjustedRect.Width * relativePositionInOriginal.X,
|
|
|
|
adjustedRect.TopLeft.Y + adjustedRect.Height * relativePositionInOriginal.Y
|
|
|
|
);
|
2021-05-19 10:58:55 +00:00
|
|
|
|
2021-05-20 09:35:13 +00:00
|
|
|
updateDrawablePosition(drawableItem, newPositionInAdjusted);
|
2021-05-19 16:47:31 +00:00
|
|
|
drawableItem.Scale *= scaledDelta;
|
2021-05-19 10:58:55 +00:00
|
|
|
}
|
2021-05-03 06:15:00 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-01-05 07:46:34 +00:00
|
|
|
public override bool HandleFlip(Direction direction, bool flipOverOrigin)
|
2021-05-13 08:51:57 +00:00
|
|
|
{
|
2022-01-06 05:47:44 +00:00
|
|
|
var selectionQuad = getSelectionQuad();
|
2021-07-01 22:38:38 +00:00
|
|
|
Vector2 scaleFactor = direction == Direction.Horizontal ? new Vector2(-1, 1) : new Vector2(1, -1);
|
2021-05-18 09:34:06 +00:00
|
|
|
|
|
|
|
foreach (var b in SelectedBlueprints)
|
2021-05-13 08:51:57 +00:00
|
|
|
{
|
2021-05-18 09:34:06 +00:00
|
|
|
var drawableItem = (Drawable)b.Item;
|
|
|
|
|
2022-01-06 05:47:44 +00:00
|
|
|
var flippedPosition = GetFlippedPosition(direction, flipOverOrigin ? drawableItem.Parent.ScreenSpaceDrawQuad : selectionQuad, b.ScreenSpaceSelectionPoint);
|
2021-05-20 09:35:13 +00:00
|
|
|
|
|
|
|
updateDrawablePosition(drawableItem, flippedPosition);
|
2021-05-18 09:34:06 +00:00
|
|
|
|
2021-07-01 22:38:38 +00:00
|
|
|
drawableItem.Scale *= scaleFactor;
|
|
|
|
drawableItem.Rotation -= drawableItem.Rotation % 180 * 2;
|
2021-05-13 08:51:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-05-13 08:06:00 +00:00
|
|
|
public override bool HandleMovement(MoveSelectionEvent<ISkinnableDrawable> moveEvent)
|
2021-05-03 06:15:00 +00:00
|
|
|
{
|
|
|
|
foreach (var c in SelectedBlueprints)
|
|
|
|
{
|
2021-06-08 14:08:02 +00:00
|
|
|
var item = c.Item;
|
|
|
|
Drawable drawable = (Drawable)item;
|
|
|
|
|
2021-05-03 06:15:00 +00:00
|
|
|
drawable.Position += drawable.ScreenSpaceDeltaToParentSpace(moveEvent.ScreenSpaceDelta);
|
2021-06-06 05:18:30 +00:00
|
|
|
|
2021-06-08 14:08:02 +00:00
|
|
|
if (item.UsesFixedAnchor) continue;
|
|
|
|
|
|
|
|
applyClosestAnchor(drawable);
|
2021-06-08 13:25:49 +00:00
|
|
|
}
|
2021-05-03 06:15:00 +00:00
|
|
|
|
2021-06-08 13:25:49 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-06-06 05:18:30 +00:00
|
|
|
|
2021-06-08 14:08:02 +00:00
|
|
|
private static void applyClosestAnchor(Drawable drawable) => applyAnchor(drawable, getClosestAnchor(drawable));
|
2021-06-06 05:18:30 +00:00
|
|
|
|
2021-05-03 06:15:00 +00:00
|
|
|
protected override void OnSelectionChanged()
|
|
|
|
{
|
|
|
|
base.OnSelectionChanged();
|
|
|
|
|
|
|
|
SelectionBox.CanRotate = true;
|
|
|
|
SelectionBox.CanScaleX = true;
|
|
|
|
SelectionBox.CanScaleY = true;
|
2021-07-21 06:59:25 +00:00
|
|
|
SelectionBox.CanFlipX = true;
|
|
|
|
SelectionBox.CanFlipY = true;
|
2021-05-03 06:15:00 +00:00
|
|
|
SelectionBox.CanReverse = false;
|
|
|
|
}
|
|
|
|
|
2021-05-14 07:03:22 +00:00
|
|
|
protected override void DeleteItems(IEnumerable<ISkinnableDrawable> items) =>
|
|
|
|
skinEditor.DeleteItems(items.ToArray());
|
2021-04-28 06:14:48 +00:00
|
|
|
|
2021-05-13 08:06:00 +00:00
|
|
|
protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint<ISkinnableDrawable>> selection)
|
2021-04-28 06:14:48 +00:00
|
|
|
{
|
2021-06-08 13:44:42 +00:00
|
|
|
var closestItem = new TernaryStateRadioMenuItem("Closest", MenuItemType.Standard, _ => applyClosestAnchors())
|
2021-06-07 05:08:39 +00:00
|
|
|
{
|
2021-06-08 12:22:35 +00:00
|
|
|
State = { Value = GetStateFromSelection(selection, c => !c.Item.UsesFixedAnchor) }
|
2021-06-07 06:40:15 +00:00
|
|
|
};
|
2021-06-06 05:18:30 +00:00
|
|
|
|
2021-06-07 06:40:15 +00:00
|
|
|
yield return new OsuMenuItem("Anchor")
|
2021-04-28 06:14:48 +00:00
|
|
|
{
|
2021-06-11 10:22:24 +00:00
|
|
|
Items = createAnchorItems((d, a) => d.UsesFixedAnchor && ((Drawable)d).Anchor == a, applyFixedAnchors)
|
2021-06-07 06:40:15 +00:00
|
|
|
.Prepend(closestItem)
|
|
|
|
.ToArray()
|
2021-05-11 05:09:56 +00:00
|
|
|
};
|
|
|
|
|
2021-06-07 06:40:15 +00:00
|
|
|
yield return new OsuMenuItem("Origin")
|
2021-05-11 05:09:56 +00:00
|
|
|
{
|
2021-06-11 10:22:24 +00:00
|
|
|
Items = createAnchorItems((d, o) => ((Drawable)d).Origin == o, applyOrigins).ToArray()
|
2021-04-28 06:14:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
foreach (var item in base.GetContextMenuItemsForSelection(selection))
|
|
|
|
yield return item;
|
|
|
|
|
2021-06-07 06:40:15 +00:00
|
|
|
IEnumerable<TernaryStateMenuItem> createAnchorItems(Func<ISkinnableDrawable, Anchor, bool> checkFunction, Action<Anchor> applyFunction)
|
|
|
|
{
|
|
|
|
var displayableAnchors = new[]
|
2021-04-28 06:14:48 +00:00
|
|
|
{
|
2021-06-07 06:40:15 +00:00
|
|
|
Anchor.TopLeft,
|
|
|
|
Anchor.TopCentre,
|
|
|
|
Anchor.TopRight,
|
|
|
|
Anchor.CentreLeft,
|
|
|
|
Anchor.Centre,
|
|
|
|
Anchor.CentreRight,
|
|
|
|
Anchor.BottomLeft,
|
|
|
|
Anchor.BottomCentre,
|
|
|
|
Anchor.BottomRight,
|
|
|
|
};
|
|
|
|
return displayableAnchors.Select(a =>
|
|
|
|
{
|
|
|
|
return new TernaryStateRadioMenuItem(a.ToString(), MenuItemType.Standard, _ => applyFunction(a))
|
2021-04-28 06:14:48 +00:00
|
|
|
{
|
2021-06-07 06:40:15 +00:00
|
|
|
State = { Value = GetStateFromSelection(selection, c => checkFunction(c.Item, a)) }
|
2021-04-28 06:14:48 +00:00
|
|
|
};
|
|
|
|
});
|
2021-06-07 06:40:15 +00:00
|
|
|
}
|
2021-04-28 06:14:48 +00:00
|
|
|
}
|
|
|
|
|
2021-05-20 09:35:13 +00:00
|
|
|
private static void updateDrawablePosition(Drawable drawable, Vector2 screenSpacePosition)
|
|
|
|
{
|
|
|
|
drawable.Position =
|
|
|
|
drawable.Parent.ToLocalSpace(screenSpacePosition) - drawable.AnchorPosition;
|
|
|
|
}
|
|
|
|
|
2021-06-08 14:29:11 +00:00
|
|
|
private void applyOrigins(Anchor origin)
|
2021-05-11 05:09:56 +00:00
|
|
|
{
|
|
|
|
foreach (var item in SelectedItems)
|
2021-05-12 06:30:52 +00:00
|
|
|
{
|
|
|
|
var drawable = (Drawable)item;
|
|
|
|
|
2021-06-08 14:29:11 +00:00
|
|
|
if (origin == drawable.Origin) continue;
|
|
|
|
|
2021-05-12 06:30:52 +00:00
|
|
|
var previousOrigin = drawable.OriginPosition;
|
2021-06-08 14:29:11 +00:00
|
|
|
drawable.Origin = origin;
|
2021-05-12 06:30:52 +00:00
|
|
|
drawable.Position += drawable.OriginPosition - previousOrigin;
|
2021-06-11 10:28:30 +00:00
|
|
|
|
|
|
|
if (item.UsesFixedAnchor) continue;
|
|
|
|
|
|
|
|
applyClosestAnchor(drawable);
|
2021-05-12 06:30:52 +00:00
|
|
|
}
|
2021-05-11 05:09:56 +00:00
|
|
|
}
|
|
|
|
|
2021-05-20 09:24:25 +00:00
|
|
|
/// <summary>
|
|
|
|
/// A screen-space quad surrounding all selected drawables, accounting for their full displayed size.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
private Quad getSelectionQuad() =>
|
|
|
|
GetSurroundingQuad(SelectedBlueprints.SelectMany(b => b.Item.ScreenSpaceDrawQuad.GetVertices().ToArray()));
|
|
|
|
|
2021-06-08 14:14:07 +00:00
|
|
|
private void applyFixedAnchors(Anchor anchor)
|
2021-04-28 06:14:48 +00:00
|
|
|
{
|
|
|
|
foreach (var item in SelectedItems)
|
2021-05-12 06:30:52 +00:00
|
|
|
{
|
|
|
|
var drawable = (Drawable)item;
|
|
|
|
|
2021-06-08 12:22:35 +00:00
|
|
|
item.UsesFixedAnchor = true;
|
2021-06-08 13:44:42 +00:00
|
|
|
applyAnchor(drawable, anchor);
|
2021-06-06 05:18:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-08 13:44:42 +00:00
|
|
|
private void applyClosestAnchors()
|
2021-06-07 06:40:15 +00:00
|
|
|
{
|
|
|
|
foreach (var item in SelectedItems)
|
|
|
|
{
|
2021-06-08 12:22:35 +00:00
|
|
|
item.UsesFixedAnchor = false;
|
2021-06-08 14:08:02 +00:00
|
|
|
applyClosestAnchor((Drawable)item);
|
2021-06-07 06:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-08 13:44:42 +00:00
|
|
|
private static Anchor getClosestAnchor(Drawable drawable)
|
2021-06-07 06:40:15 +00:00
|
|
|
{
|
|
|
|
var parent = drawable.Parent;
|
|
|
|
|
|
|
|
if (parent == null)
|
|
|
|
return drawable.Anchor;
|
|
|
|
|
2021-06-22 07:40:56 +00:00
|
|
|
var screenPosition = getScreenPosition();
|
2021-06-11 10:55:47 +00:00
|
|
|
|
2021-06-07 06:40:15 +00:00
|
|
|
var absolutePosition = parent.ToLocalSpace(screenPosition);
|
|
|
|
var factor = parent.RelativeToAbsoluteFactor;
|
|
|
|
|
|
|
|
var result = default(Anchor);
|
|
|
|
|
2021-06-11 10:53:40 +00:00
|
|
|
static Anchor getAnchorFromPosition(float xOrY, Anchor anchor0, Anchor anchor1, Anchor anchor2)
|
2021-06-11 10:51:12 +00:00
|
|
|
{
|
2021-06-11 10:53:40 +00:00
|
|
|
if (xOrY >= 2 / 3f)
|
2021-06-11 10:53:04 +00:00
|
|
|
return anchor2;
|
2021-06-11 10:51:12 +00:00
|
|
|
|
2021-06-11 10:53:40 +00:00
|
|
|
if (xOrY >= 1 / 3f)
|
2021-06-11 10:53:04 +00:00
|
|
|
return anchor1;
|
2021-06-11 10:51:12 +00:00
|
|
|
|
2021-06-11 10:53:04 +00:00
|
|
|
return anchor0;
|
2021-06-11 10:51:12 +00:00
|
|
|
}
|
|
|
|
|
2021-06-11 10:53:40 +00:00
|
|
|
result |= getAnchorFromPosition(absolutePosition.X / factor.X, Anchor.x0, Anchor.x1, Anchor.x2);
|
|
|
|
result |= getAnchorFromPosition(absolutePosition.Y / factor.Y, Anchor.y0, Anchor.y1, Anchor.y2);
|
2021-06-07 06:40:15 +00:00
|
|
|
|
|
|
|
return result;
|
2021-06-22 07:40:56 +00:00
|
|
|
|
|
|
|
Vector2 getScreenPosition()
|
|
|
|
{
|
|
|
|
var quad = drawable.ScreenSpaceDrawQuad;
|
|
|
|
var origin = drawable.Origin;
|
|
|
|
|
|
|
|
var pos = quad.TopLeft;
|
|
|
|
|
|
|
|
if (origin.HasFlagFast(Anchor.x2))
|
|
|
|
pos.X += quad.Width;
|
|
|
|
else if (origin.HasFlagFast(Anchor.x1))
|
|
|
|
pos.X += quad.Width / 2f;
|
|
|
|
|
|
|
|
if (origin.HasFlagFast(Anchor.y2))
|
|
|
|
pos.Y += quad.Height;
|
|
|
|
else if (origin.HasFlagFast(Anchor.y1))
|
|
|
|
pos.Y += quad.Height / 2f;
|
|
|
|
|
|
|
|
return pos;
|
|
|
|
}
|
2021-06-07 06:40:15 +00:00
|
|
|
}
|
|
|
|
|
2021-06-08 13:44:42 +00:00
|
|
|
private static void applyAnchor(Drawable drawable, Anchor anchor)
|
2021-06-06 05:18:30 +00:00
|
|
|
{
|
2021-06-08 13:51:39 +00:00
|
|
|
if (anchor == drawable.Anchor) return;
|
|
|
|
|
2021-06-06 05:18:30 +00:00
|
|
|
var previousAnchor = drawable.AnchorPosition;
|
|
|
|
drawable.Anchor = anchor;
|
|
|
|
drawable.Position -= drawable.AnchorPosition - previousAnchor;
|
|
|
|
}
|
|
|
|
|
2021-04-28 06:14:48 +00:00
|
|
|
private static void adjustScaleFromAnchor(ref Vector2 scale, Anchor reference)
|
|
|
|
{
|
|
|
|
// cancel out scale in axes we don't care about (based on which drag handle was used).
|
|
|
|
if ((reference & Anchor.x1) > 0) scale.X = 0;
|
|
|
|
if ((reference & Anchor.y1) > 0) scale.Y = 0;
|
|
|
|
|
|
|
|
// reverse the scale direction if dragging from top or left.
|
|
|
|
if ((reference & Anchor.x0) > 0) scale.X = -scale.X;
|
|
|
|
if ((reference & Anchor.y0) > 0) scale.Y = -scale.Y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|