1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 06:47:24 +08:00
osu-lazer/osu.Game/Screens/Edit/Compose/Components/MoveSelectionEvent.cs
Dean Herbert 9c62c90cfc Refactor SelectionBlueprint and MoveSelectionEvent to work in screen-space coordinates
Until now, the implementation of the overrides in `SelectionBlueprint`
have been confusing to the point where I would just implement by
trial-and-error (or copying from an existing implementation). This was
due to a combination of using "object" space coordinates
(ie. the thing the `Blueprint` is operating on) and screen-space coordinates.

This change switches all event related coordinates to screen-space,
which is how we already handle rotation/scale operations. With the
introduction of other editor types where the related objects are
drawables, this also makes a lot more sense.
2021-04-29 16:10:42 +09:00

31 lines
984 B
C#

// 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 osu.Game.Rulesets.Edit;
using osuTK;
namespace osu.Game.Screens.Edit.Compose.Components
{
/// <summary>
/// An event which occurs when a <see cref="OverlaySelectionBlueprint"/> is moved.
/// </summary>
public class MoveSelectionEvent<T>
{
/// <summary>
/// The <see cref="SelectionBlueprint{T}"/> that triggered this <see cref="MoveSelectionEvent{T}"/>.
/// </summary>
public readonly SelectionBlueprint<T> Blueprint;
/// <summary>
/// The screen-space delta of this move event.
/// </summary>
public readonly Vector2 ScreenSpaceDelta;
public MoveSelectionEvent(SelectionBlueprint<T> blueprint, Vector2 screenSpaceDelta)
{
Blueprint = blueprint;
ScreenSpaceDelta = screenSpaceDelta;
}
}
}