1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:07:24 +08:00

Fix bottom timeline break visualisations not updating

This commit is contained in:
Bartłomiej Dach 2024-06-18 15:54:34 +02:00
parent 814f1e552f
commit f88f05717a
No known key found for this signature in database
2 changed files with 17 additions and 26 deletions

View File

@ -2,9 +2,10 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Timing;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations;
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
{ {
@ -20,11 +21,24 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
Add(new BreakVisualisation(breakPeriod)); Add(new BreakVisualisation(breakPeriod));
} }
private partial class BreakVisualisation : DurationVisualisation private partial class BreakVisualisation : Circle
{ {
private readonly BreakPeriod breakPeriod;
public BreakVisualisation(BreakPeriod breakPeriod) public BreakVisualisation(BreakPeriod breakPeriod)
: base(breakPeriod.StartTime, breakPeriod.EndTime)
{ {
this.breakPeriod = breakPeriod;
RelativePositionAxes = Axes.X;
RelativeSizeAxes = Axes.Both;
}
protected override void Update()
{
base.Update();
X = (float)breakPeriod.StartTime;
Width = (float)breakPeriod.Duration;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -1,23 +0,0 @@
// 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 osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations
{
/// <summary>
/// Represents a spanning point on a timeline part.
/// </summary>
public partial class DurationVisualisation : Circle
{
protected DurationVisualisation(double startTime, double endTime)
{
RelativePositionAxes = Axes.X;
RelativeSizeAxes = Axes.Both;
X = (float)startTime;
Width = (float)(endTime - startTime);
}
}
}