mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Expose distance spacing in IPositionSnapProvider
for updating distance grid
Alternate method is to expose a `SnapDistancesChanged` event in `IPositionSnapProvider` instead, but I chose this way as an analogue to `IBeatSnapProvider.BeatDivisor`, which might even make sense to be exposed as `BindableBeatDivisor` instead of caching that separately.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -52,6 +53,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
[Resolved]
|
||||
private BindableBeatDivisor beatDivisor { get; set; }
|
||||
|
||||
private IBindable<float> distanceSpacingMultiplier;
|
||||
|
||||
private readonly LayoutValue gridCache = new LayoutValue(Invalidation.RequiredParentSizeToFit);
|
||||
private readonly double? endTime;
|
||||
|
||||
@ -82,6 +85,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
base.LoadComplete();
|
||||
|
||||
beatDivisor.BindValueChanged(_ => updateSpacing(), true);
|
||||
|
||||
distanceSpacingMultiplier = SnapProvider.DistanceSpacingMultiplier.GetBoundCopy();
|
||||
distanceSpacingMultiplier.BindValueChanged(_ => updateSpacing(), true);
|
||||
}
|
||||
|
||||
private void updateSpacing()
|
||||
|
Reference in New Issue
Block a user