mirror of
https://github.com/ppy/osu.git
synced 2025-01-16 04:32:57 +08:00
Merge pull request #14350 from LittleEndu/cursor-trail-middle
Avoid drawing segments of cursor trail near current cursor position
This commit is contained in:
commit
52b9616909
@ -62,6 +62,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
protected override bool InterpolateMovements => !disjointTrail;
|
protected override bool InterpolateMovements => !disjointTrail;
|
||||||
|
|
||||||
protected override float IntervalMultiplier => 1 / Math.Max(cursorSize.Value, 1);
|
protected override float IntervalMultiplier => 1 / Math.Max(cursorSize.Value, 1);
|
||||||
|
protected override bool AvoidDrawingNearCursor => !disjointTrail;
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
|
@ -138,6 +138,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
protected virtual bool InterpolateMovements => true;
|
protected virtual bool InterpolateMovements => true;
|
||||||
|
|
||||||
protected virtual float IntervalMultiplier => 1.0f;
|
protected virtual float IntervalMultiplier => 1.0f;
|
||||||
|
protected virtual bool AvoidDrawingNearCursor => false;
|
||||||
|
|
||||||
private Vector2? lastPosition;
|
private Vector2? lastPosition;
|
||||||
private readonly InputResampler resampler = new InputResampler();
|
private readonly InputResampler resampler = new InputResampler();
|
||||||
@ -171,8 +172,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
Vector2 direction = diff / distance;
|
Vector2 direction = diff / distance;
|
||||||
|
|
||||||
float interval = partSize.X / 2.5f * IntervalMultiplier;
|
float interval = partSize.X / 2.5f * IntervalMultiplier;
|
||||||
|
float stopAt = distance - (AvoidDrawingNearCursor ? interval : 0);
|
||||||
|
|
||||||
for (float d = interval; d < distance; d += interval)
|
for (float d = interval; d < stopAt; d += interval)
|
||||||
{
|
{
|
||||||
lastPosition = pos1 + direction * d;
|
lastPosition = pos1 + direction * d;
|
||||||
addPart(lastPosition.Value);
|
addPart(lastPosition.Value);
|
||||||
|
Loading…
Reference in New Issue
Block a user