mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
Add visual offset to better align editor waveforms with expectations
This commit is contained in:
parent
ef4191fb57
commit
f9e47242db
@ -141,7 +141,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
waveformOpacity = config.GetBindable<float>(OsuSetting.EditorWaveformOpacity);
|
||||
|
||||
track.BindTo(editorClock.Track);
|
||||
track.BindValueChanged(_ => waveform.Waveform = beatmap.Value.Waveform, true);
|
||||
track.BindValueChanged(_ =>
|
||||
{
|
||||
waveform.Waveform = beatmap.Value.Waveform;
|
||||
waveform.RelativePositionAxes = Axes.X;
|
||||
waveform.X = -(float)(Editor.WAVEFORM_VISUAL_OFFSET / beatmap.Value.Track.Length);
|
||||
}, true);
|
||||
|
||||
Zoom = (float)(defaultTimelineZoom * editorBeatmap.BeatmapInfo.TimelineZoom);
|
||||
}
|
||||
|
@ -60,6 +60,19 @@ namespace osu.Game.Screens.Edit
|
||||
[Cached]
|
||||
public partial class Editor : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>, IKeyBindingHandler<PlatformAction>, IBeatSnapProvider, ISamplePlaybackDisabler, IBeatSyncProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// An offset applied to waveform visuals to align them with expectations.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Historically, osu! beatmaps have an assumption of full system latency baked in.
|
||||
/// This comes from a culmination of stable's platform offset, average hardware playback
|
||||
/// latency, and users having their universal offsets tweaked to previous beatmaps.
|
||||
///
|
||||
/// Coming to this value involved running various tests with existing users / beatmaps.
|
||||
/// This included both visual and audible comparisons. Ballpark confidence is ≈2 ms.
|
||||
/// </remarks>
|
||||
public const float WAVEFORM_VISUAL_OFFSET = 20;
|
||||
|
||||
public override float BackgroundParallaxAmount => 0.1f;
|
||||
|
||||
public override bool AllowBackButton => false;
|
||||
|
@ -219,7 +219,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
// offset to the required beat index.
|
||||
double time = selectedGroupStartTime + index * timingPoint.BeatLength;
|
||||
|
||||
float offset = (float)(time - visible_width / 2) / trackLength * scale;
|
||||
float offset = (float)(time - visible_width / 2 + Editor.WAVEFORM_VISUAL_OFFSET) / trackLength * scale;
|
||||
|
||||
row.Alpha = time < selectedGroupStartTime || time > selectedGroupEndTime ? 0.2f : 1;
|
||||
row.WaveformOffsetTo(-offset, animated);
|
||||
|
Loading…
Reference in New Issue
Block a user