mirror of
https://github.com/osukey/osukey.git
synced 2025-07-16 15:59:58 +09:00
Fix inspect issues
This commit is contained in:
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -184,7 +183,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
double maxTime = dragBox.MaxTime;
|
double maxTime = dragBox.MaxTime;
|
||||||
|
|
||||||
SelectedItems.RemoveAll(hitObject => !shouldBeSelected(hitObject));
|
SelectedItems.RemoveAll(hitObject => !shouldBeSelected(hitObject));
|
||||||
SelectedItems.AddRange(Beatmap.HitObjects.Except(SelectedItems).Where(hitObject => shouldBeSelected(hitObject)));
|
SelectedItems.AddRange(Beatmap.HitObjects.Except(SelectedItems).Where(shouldBeSelected));
|
||||||
|
|
||||||
bool shouldBeSelected(HitObject hitObject) => minTime <= hitObject.StartTime && hitObject.StartTime <= maxTime;
|
bool shouldBeSelected(HitObject hitObject) => minTime <= hitObject.StartTime && hitObject.StartTime <= maxTime;
|
||||||
}
|
}
|
||||||
|
@ -8,20 +8,17 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Utils;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||||
{
|
{
|
||||||
public class TimelineDragBox : DragBox
|
public class TimelineDragBox : DragBox
|
||||||
{
|
{
|
||||||
public double MinTime => Math.Min(startTime.Value, endTime);
|
public double MinTime { get; private set; }
|
||||||
|
|
||||||
public double MaxTime => Math.Max(startTime.Value, endTime);
|
public double MaxTime { get; private set; }
|
||||||
|
|
||||||
private double? startTime;
|
private double? startTime;
|
||||||
|
|
||||||
private double endTime;
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private Timeline timeline { get; set; }
|
private Timeline timeline { get; set; }
|
||||||
|
|
||||||
@ -34,7 +31,10 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
public override void HandleDrag(MouseButtonEvent e)
|
public override void HandleDrag(MouseButtonEvent e)
|
||||||
{
|
{
|
||||||
startTime ??= timeline.TimeAtPosition(e.MouseDownPosition.X);
|
startTime ??= timeline.TimeAtPosition(e.MouseDownPosition.X);
|
||||||
endTime = timeline.TimeAtPosition(e.MousePosition.X);
|
double endTime = timeline.TimeAtPosition(e.MousePosition.X);
|
||||||
|
|
||||||
|
MinTime = Math.Min(startTime.Value, endTime);
|
||||||
|
MaxTime = Math.Max(startTime.Value, endTime);
|
||||||
|
|
||||||
Box.X = timeline.PositionAtTime(MinTime);
|
Box.X = timeline.PositionAtTime(MinTime);
|
||||||
Box.Width = timeline.PositionAtTime(MaxTime) - Box.X;
|
Box.Width = timeline.PositionAtTime(MaxTime) - Box.X;
|
||||||
|
Reference in New Issue
Block a user