1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Merge pull request #7751 from peppy/fix-editor-snapping-inaccuracy

Fix duration snapping still being incorrect
This commit is contained in:
Dan Balasescu 2020-02-07 17:56:56 +09:00 committed by GitHub
commit 66f5ad4adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,7 +289,11 @@ namespace osu.Game.Rulesets.Edit
=> beatSnapProvider.SnapTime(referenceTime + DistanceToDuration(referenceTime, distance), referenceTime) - referenceTime;
public override float GetSnappedDistanceFromDistance(double referenceTime, float distance)
=> DurationToDistance(referenceTime, beatSnapProvider.SnapTime(DistanceToDuration(referenceTime, distance), referenceTime));
{
var snappedEndTime = beatSnapProvider.SnapTime(referenceTime + DistanceToDuration(referenceTime, distance), referenceTime);
return DurationToDistance(referenceTime, snappedEndTime - referenceTime);
}
public override void UpdateHitObject(HitObject hitObject) => EditorBeatmap.UpdateHitObject(hitObject);