mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Expose DistanceSpacingMultiplier
to distance
This commit is contained in:
@ -25,6 +25,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected float DistanceBetweenTick { get; private set; }
|
protected float DistanceBetweenTick { get; private set; }
|
||||||
|
|
||||||
|
protected IBindable<double> DistanceSpacingMultiplier { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum number of distance snapping intervals allowed.
|
/// The maximum number of distance snapping intervals allowed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -53,8 +55,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private BindableBeatDivisor beatDivisor { get; set; }
|
private BindableBeatDivisor beatDivisor { get; set; }
|
||||||
|
|
||||||
private IBindable<double> distanceSpacingMultiplier;
|
|
||||||
|
|
||||||
private readonly LayoutValue gridCache = new LayoutValue(Invalidation.RequiredParentSizeToFit);
|
private readonly LayoutValue gridCache = new LayoutValue(Invalidation.RequiredParentSizeToFit);
|
||||||
private readonly double? endTime;
|
private readonly double? endTime;
|
||||||
|
|
||||||
@ -86,13 +86,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
beatDivisor.BindValueChanged(_ => updateSpacing());
|
beatDivisor.BindValueChanged(_ => updateSpacing());
|
||||||
|
|
||||||
distanceSpacingMultiplier = SnapProvider.DistanceSpacingMultiplier.GetBoundCopy();
|
DistanceSpacingMultiplier = SnapProvider.DistanceSpacingMultiplier.GetBoundCopy();
|
||||||
distanceSpacingMultiplier.BindValueChanged(_ => updateSpacing(), true);
|
DistanceSpacingMultiplier.BindValueChanged(_ => updateSpacing(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateSpacing()
|
private void updateSpacing()
|
||||||
{
|
{
|
||||||
DistanceBetweenTick = (float)(SnapProvider.GetBeatSnapDistanceAt(ReferenceObject) * distanceSpacingMultiplier.Value);
|
DistanceBetweenTick = (float)(SnapProvider.GetBeatSnapDistanceAt(ReferenceObject) * DistanceSpacingMultiplier.Value);
|
||||||
|
|
||||||
if (endTime == null)
|
if (endTime == null)
|
||||||
MaxIntervals = int.MaxValue;
|
MaxIntervals = int.MaxValue;
|
||||||
|
Reference in New Issue
Block a user