Use box variant of selection always

This commit is contained in:
Bartłomiej Dach 2024-11-07 08:41:29 +01:00
parent fd17966605
commit aede94a3f3
No known key found for this signature in database
1 changed files with 1 additions and 13 deletions

View File

@ -1,7 +1,6 @@
// 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 System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -17,6 +16,7 @@ public partial class EditNotePiece : CompositeDrawable
public EditNotePiece()
{
Masking = true;
CornerRadius = 5;
BorderThickness = 9; // organoleptically chosen to look good enough for all default skins
BorderColour = Color4.White;
Height = DefaultNotePiece.NOTE_HEIGHT;
@ -34,17 +34,5 @@ private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
protected override void Update()
{
base.Update();
// from anecdotal experience, there are generally two types of user skins:
// one type uses rectangles for notes, and the other uses circles / squarish sprites (various stepmania-likes).
// this is a crude heuristic that attempts to choose the best of both worlds based on aspect ratio alone.
float aspectRatio = DrawWidth / DrawHeight;
bool isSquarish = aspectRatio > 4f / 5 && aspectRatio < 5f / 4;
CornerRadius = isSquarish ? Math.Min(DrawWidth, DrawHeight) / 2 : 5;
}
}
}