1
0
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:
Bartłomiej Dach
2025-06-24 12:01:07 +02:00
committed by GitHub
Unverified
2 changed files with 3 additions and 1 deletions
@@ -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; }