1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 18:42:56 +08:00

Account for the width of points so they don't suddenly appear at timeline edges

This commit is contained in:
Dean Herbert 2020-10-09 16:49:51 +09:00
parent ceb1494c33
commit 5d888f687a
2 changed files with 6 additions and 4 deletions

View File

@ -12,6 +12,8 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations
/// </summary> /// </summary>
public class PointVisualisation : Box public class PointVisualisation : Box
{ {
public const float WIDTH = 1;
public PointVisualisation(double startTime) public PointVisualisation(double startTime)
: this() : this()
{ {
@ -25,8 +27,8 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations
RelativePositionAxes = Axes.X; RelativePositionAxes = Axes.X;
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
Width = 1; Width = WIDTH;
EdgeSmoothness = new Vector2(1, 0); EdgeSmoothness = new Vector2(WIDTH, 0);
} }
} }
} }

View File

@ -66,8 +66,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
if (timeline != null) if (timeline != null)
{ {
var newRange = ( var newRange = (
ToLocalSpace(timeline.ScreenSpaceDrawQuad.TopLeft).X / DrawWidth * Content.RelativeChildSize.X, (ToLocalSpace(timeline.ScreenSpaceDrawQuad.TopLeft).X - PointVisualisation.WIDTH * 2) / DrawWidth * Content.RelativeChildSize.X,
ToLocalSpace(timeline.ScreenSpaceDrawQuad.TopRight).X / DrawWidth * Content.RelativeChildSize.X); (ToLocalSpace(timeline.ScreenSpaceDrawQuad.TopRight).X + PointVisualisation.WIDTH * 2) / DrawWidth * Content.RelativeChildSize.X);
if (visibleRange != newRange) if (visibleRange != newRange)
{ {