Skip to content

Commit

Permalink
Fix slider ball returning to origin when the slider ends
Browse files Browse the repository at this point in the history
  • Loading branch information
Reco1I committed Nov 21, 2024
1 parent c7960f1 commit 7e18cf8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ru/nsu/ccfit/zuev/osu/game/GameplaySlider.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,12 @@ public void init(final GameObjectListener listener, final Scene scene,
private PointF getPositionAt(final float percentage, final boolean updateBallAngle, final boolean updateEndArrowRotation) {
tmpPoint.set(position);

if (path.pointCount < 2 || percentage >= 1) {
if (path.pointCount < 2) {
return tmpPoint;
}

if (percentage >= 1) {
tmpPoint.set(pathEndPosition);
return tmpPoint;
}

Expand Down

0 comments on commit 7e18cf8

Please sign in to comment.