Don't show the flip button when flipping is a no-op

This commit is contained in:
ekrctb 2021-07-22 13:06:48 +09:00
parent 73866c2837
commit 7b6981c632
2 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,8 @@ protected override void OnSelectionChanged()
{
base.OnSelectionChanged();
SelectionBox.CanFlipX = true;
var selectionRange = CatchHitObjectUtils.GetPositionRange(EditorBeatmap.SelectedHitObjects);
SelectionBox.CanFlipX = selectionRange.Length > 0 && EditorBeatmap.SelectedHitObjects.Any(h => h is CatchHitObject && !(h is BananaShower));
}
/// <summary>

View File

@ -15,6 +15,8 @@ public readonly struct PositionRange
public readonly float Min;
public readonly float Max;
public float Length => Max - Min;
public PositionRange(float value)
: this(value, value)
{