mirror of
https://github.com/osukey/osukey.git
synced 2025-05-07 22:57:31 +09:00
Allow moving timeline selection when mousedown event is outside of blueprint container
This commit is contained in:
parent
ee220feecf
commit
2e2a2bdd99
@ -35,8 +35,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
private Bindable<HitObject> placement;
|
private Bindable<HitObject> placement;
|
||||||
private SelectionBlueprint<HitObject> placementBlueprint;
|
private SelectionBlueprint<HitObject> placementBlueprint;
|
||||||
|
|
||||||
private SelectableAreaBackground backgroundBox;
|
|
||||||
|
|
||||||
// We want children to be able to be clicked and dragged, regardless of this drawable's size
|
// We want children to be able to be clicked and dragged, regardless of this drawable's size
|
||||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
@ -53,7 +51,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AddInternal(backgroundBox = new SelectableAreaBackground
|
AddInternal(new SelectableAreaBackground
|
||||||
{
|
{
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Depth = float.MaxValue,
|
Depth = float.MaxValue,
|
||||||
@ -92,15 +90,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
protected override Container<SelectionBlueprint<HitObject>> CreateSelectionBlueprintContainer() => new TimelineSelectionBlueprintContainer { RelativeSizeAxes = Axes.Both };
|
protected override Container<SelectionBlueprint<HitObject>> CreateSelectionBlueprintContainer() => new TimelineSelectionBlueprintContainer { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
protected override bool OnDragStart(DragStartEvent e)
|
|
||||||
{
|
|
||||||
// We should only allow BlueprintContainer to create a drag box if the mouse is within selection bounds
|
|
||||||
if (backgroundBox.ReceivePositionalInputAt(e.ScreenSpaceMouseDownPosition))
|
|
||||||
return base.OnDragStart(e);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnDrag(DragEvent e)
|
protected override void OnDrag(DragEvent e)
|
||||||
{
|
{
|
||||||
handleScrollViaDrag(e);
|
handleScrollViaDrag(e);
|
||||||
@ -319,6 +308,10 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
public override bool HandleDrag(MouseButtonEvent e)
|
public override bool HandleDrag(MouseButtonEvent e)
|
||||||
{
|
{
|
||||||
|
// The dragbox should only be active if the mouseDownPosition.Y is within this drawable's bounds.
|
||||||
|
if (DrawRectangle.Top > e.MouseDownPosition.Y || DrawRectangle.Bottom < e.MouseDownPosition.Y)
|
||||||
|
return false;
|
||||||
|
|
||||||
selectionStart ??= e.MouseDownPosition.X / timeline.CurrentZoom;
|
selectionStart ??= e.MouseDownPosition.X / timeline.CurrentZoom;
|
||||||
|
|
||||||
// only calculate end when a transition is not in progress to avoid bouncing.
|
// only calculate end when a transition is not in progress to avoid bouncing.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user