mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 06:42:54 +08:00
9c62c90cfc
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.
31 lines
984 B
C#
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;
|
|
}
|
|
}
|
|
}
|