1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Fix vertical drag in down-scroll scenarios

This commit is contained in:
smoogipoo 2020-04-28 18:36:24 +09:00
parent 7d54d4b800
commit ff24a15760

View File

@ -52,9 +52,9 @@ namespace osu.Game.Rulesets.Mania.Edit
if (drawableRuleset.ScrollingInfo.Direction.Value == ScrollingDirection.Down) if (drawableRuleset.ScrollingInfo.Direction.Value == ScrollingDirection.Down)
{ {
// When scrolling downwards, the position is _negative_ when the object's start time is after the current time (e.g. in the middle of the stage). // We're dealing with screen coordinates in which the position decreases towards the centre of the screen resulting in an increase in start time.
// However all scrolling algorithms upwards scrolling, meaning that a positive (inverse) position is expected in the same scenario. // The scrolling algorithm assumes a top anchor meaning an increase in time corresponds to an increase in position, so when scrolling downwards the coordinates need to be flipped.
targetPosition = -targetPosition; targetPosition = hoc.DrawHeight - targetPosition;
} }
double targetTime = drawableRuleset.ScrollingInfo.Algorithm.TimeAt(targetPosition, double targetTime = drawableRuleset.ScrollingInfo.Algorithm.TimeAt(targetPosition,