Fix banana shower placement outline initial opacity

This commit is contained in:
ekrctb 2021-06-23 10:26:01 +09:00
parent 5a5cb39c9f
commit 125e143401
1 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,8 @@ public class TimeSpanOutline : CompositeDrawable
{
private const float border_width = 4;
private const float opacity_when_empty = 0.5f;
private bool isEmpty = true;
public TimeSpanOutline()
@ -26,6 +28,7 @@ public TimeSpanOutline()
Masking = true;
BorderThickness = border_width;
Alpha = opacity_when_empty;
// A box is needed to make the border visible.
InternalChild = new Box
@ -52,7 +55,7 @@ public void UpdateFrom(ScrollingHitObjectContainer hitObjectContainer, BananaSho
bool wasEmpty = isEmpty;
isEmpty = height == 0;
if (wasEmpty != isEmpty)
this.FadeTo(isEmpty ? 0.5f : 1f, 150);
this.FadeTo(isEmpty ? opacity_when_empty : 1f, 150);
Height = Math.Max(height, border_width);
}