1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 05:37:24 +08:00

Compatible IHasDuration hitobjects now scale with BPM changes

Does not apply to hitobjects with IHasRepeats
This commit is contained in:
Aurelian 2024-06-03 23:02:57 +02:00
parent a940809fbf
commit 09f3fb9eee

View File

@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -18,6 +17,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Overlays;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osuTK;
namespace osu.Game.Screens.Edit.Timing
@ -272,6 +272,9 @@ namespace osu.Game.Screens.Edit.Timing
double beat = (hitObject.StartTime - selectedGroup.Value!.Time) / timing.BeatLength;
hitObject.StartTime = (beat * newBeatLength) + selectedGroup.Value.Time;
if (hitObject is not IHasRepeats && hitObject is IHasDuration hitObjectWithDuration)
hitObjectWithDuration.Duration *= newBeatLength / timing.BeatLength;
}
}