mirror of
https://github.com/ppy/osu.git
synced 2026-05-28 09:50:04 +08:00
Merge pull request #33856 from peppy/fix-skin-editor-rotation
Fix rotating objects in the skin editor not rotating as expected
This commit is contained in:
@@ -59,7 +59,7 @@ namespace osu.Game.Overlays.SkinEditor
|
||||
objectsInRotation = selectedItems.Cast<Drawable>().ToArray();
|
||||
originalRotations = objectsInRotation.ToDictionary(d => d, d => d.Rotation);
|
||||
originalPositions = objectsInRotation.ToDictionary(d => d, d => d.ToScreenSpace(d.OriginPosition));
|
||||
DefaultOrigin = GeometryUtils.GetSurroundingQuad(objectsInRotation.SelectMany(d => d.ScreenSpaceDrawQuad.GetVertices().ToArray())).Centre;
|
||||
DefaultOrigin = GeometryUtils.GetSurroundingQuad(objectsInRotation.SelectMany(d => ToLocalSpace(d.ScreenSpaceDrawQuad).GetVertices().ToArray())).Centre;
|
||||
|
||||
base.Begin();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <summary>
|
||||
/// Implementation-defined origin point to rotate around when no explicit origin is provided.
|
||||
/// This field is only assigned during a rotation operation.
|
||||
///
|
||||
/// Coordinates are in local space for this container.
|
||||
/// </summary>
|
||||
public Vector2? DefaultOrigin { get; protected set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user