mirror of
https://github.com/osukey/osukey.git
synced 2025-06-25 05:07:59 +09:00
Fix incorrect rounding in DragBar
This commit is contained in:
parent
af30d1201f
commit
5ea33f4c04
@ -181,8 +181,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IBeatSnapProvider beatSnapProvider { get; set; }
|
private IBeatSnapProvider beatSnapProvider { get; set; }
|
||||||
|
|
||||||
public SnapResult SnapScreenSpacePositionToValidTime(Vector2 position) =>
|
public SnapResult SnapScreenSpacePositionToValidTime(Vector2 screenSpacePosition) =>
|
||||||
new SnapResult(position, beatSnapProvider.SnapTime(getTimeFromPosition(Content.ToLocalSpace(position))));
|
new SnapResult(screenSpacePosition, beatSnapProvider.SnapTime(getTimeFromPosition(Content.ToLocalSpace(screenSpacePosition))));
|
||||||
|
|
||||||
private double getTimeFromPosition(Vector2 localPosition) =>
|
private double getTimeFromPosition(Vector2 localPosition) =>
|
||||||
(localPosition.X / Content.DrawWidth) * track.Length;
|
(localPosition.X / Content.DrawWidth) * track.Length;
|
||||||
|
@ -282,7 +282,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
case IHasRepeats repeatHitObject:
|
case IHasRepeats repeatHitObject:
|
||||||
// find the number of repeats which can fit in the requested time.
|
// find the number of repeats which can fit in the requested time.
|
||||||
var lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1);
|
var lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1);
|
||||||
var proposedCount = Math.Max(0, (int)((time - hitObject.StartTime) / lengthOfOneRepeat) - 1);
|
var proposedCount = Math.Max(0, (int)Math.Round((time - hitObject.StartTime) / lengthOfOneRepeat) - 1);
|
||||||
|
|
||||||
if (proposedCount == repeatHitObject.RepeatCount)
|
if (proposedCount == repeatHitObject.RepeatCount)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user