mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 03:23:05 +08:00
Fix StackHeight changes not causing position updates
This commit is contained in:
parent
7809ce9361
commit
1cd11a6e5b
@ -61,6 +61,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
Size = circle.DrawSize;
|
||||
|
||||
HitObject.PositionChanged += _ => Position = HitObject.StackedPosition;
|
||||
HitObject.StackHeightChanged += _ => Position = HitObject.StackedPosition;
|
||||
}
|
||||
|
||||
public override Color4 AccentColour
|
||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
public const double OBJECT_RADIUS = 64;
|
||||
|
||||
public event Action<Vector2> PositionChanged;
|
||||
public event Action<int> StackHeightChanged;
|
||||
|
||||
public double TimePreempt = 600;
|
||||
public double TimeFadeIn = 400;
|
||||
@ -44,7 +45,20 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public Vector2 StackedEndPosition => EndPosition + StackOffset;
|
||||
|
||||
public virtual int StackHeight { get; set; }
|
||||
private int stackHeight;
|
||||
|
||||
public int StackHeight
|
||||
{
|
||||
get => stackHeight;
|
||||
set
|
||||
{
|
||||
if (stackHeight == value)
|
||||
return;
|
||||
stackHeight = value;
|
||||
|
||||
StackHeightChanged?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 StackOffset => new Vector2(StackHeight * Scale * -6.4f);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user