mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 21:23:04 +08:00
Follow start time and duration changes
This commit is contained in:
parent
63cef8b8b7
commit
f0d810fe20
@ -2,6 +2,8 @@
|
|||||||
// 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 System;
|
using System;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
@ -115,6 +117,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private readonly Container extensionBar;
|
private readonly Container extensionBar;
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
private readonly Bindable<double> startTime;
|
||||||
|
|
||||||
public const float THICKNESS = 3;
|
public const float THICKNESS = 3;
|
||||||
|
|
||||||
private const float circle_size = 16;
|
private const float circle_size = 16;
|
||||||
@ -127,9 +132,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
Anchor = Anchor.CentreLeft;
|
Anchor = Anchor.CentreLeft;
|
||||||
Origin = Anchor.CentreLeft;
|
Origin = Anchor.CentreLeft;
|
||||||
|
|
||||||
Width = (float)(hitObject.GetEndTime() - hitObject.StartTime);
|
startTime = hitObject.StartTimeBindable.GetBoundCopy();
|
||||||
|
startTime.BindValueChanged(time => X = (float)time.NewValue, true);
|
||||||
X = (float)hitObject.StartTime;
|
|
||||||
|
|
||||||
RelativePositionAxes = Axes.X;
|
RelativePositionAxes = Axes.X;
|
||||||
|
|
||||||
@ -168,6 +172,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
// no bindable so we perform this every update
|
||||||
|
Width = (float)(HitObject.GetEndTime() - HitObject.StartTime);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnSelected()
|
protected override void OnSelected()
|
||||||
{
|
{
|
||||||
circle.BorderColour = Color4.Orange;
|
circle.BorderColour = Color4.Orange;
|
||||||
|
Loading…
Reference in New Issue
Block a user