From 06445e59c4d077823ecc53241abb068680464741 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 3 Dec 2016 20:13:58 +0100 Subject: [PATCH] fix slider leftovers being drawn --- src/itdelatrisu/opsu/GameData.java | 2 +- src/itdelatrisu/opsu/objects/Slider.java | 1 + src/itdelatrisu/opsu/render/CurveRenderState.java | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index 7a051a53..3e735760 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -913,7 +913,7 @@ public class GameData { float oldColorAlpha = hitResult.color.a; Colors.WHITE_FADE.a = alpha; hitResult.color.a = alpha; - hitResult.curve.draw(hitResult.color); + //hitResult.curve.draw(hitResult.color); Colors.WHITE_FADE.a = oldWhiteAlpha; hitResult.color.a = oldColorAlpha; } diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 858e4767..0157b4dc 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -557,6 +557,7 @@ public class Slider extends GameObject { // calculate and send slider result hitResult(); + game.setSlidercurveFrom(baseSliderFrom + curve.getCurvePoints().length); return true; } diff --git a/src/itdelatrisu/opsu/render/CurveRenderState.java b/src/itdelatrisu/opsu/render/CurveRenderState.java index f136bbcb..c4275a4a 100644 --- a/src/itdelatrisu/opsu/render/CurveRenderState.java +++ b/src/itdelatrisu/opsu/render/CurveRenderState.java @@ -280,13 +280,14 @@ public class CurveRenderState { float last_y = curve[i - 1].y; double diff_x = x - last_x; double diff_y = y - last_y; - if (diff_x < Circle.diameter / 8 && diff_y < Circle.diameter / 8) { + float dist = Utils.distance(x, y, last_x, last_y); + if (dist < Circle.diameter / 8) { x = (float) (x - diff_x / 2); y = (float) (y - diff_y / 2); } else { - x = curve[i+1].x; - y = curve[i+1].y; - System.out.println("next"); + // don't mind me + x = -100f; + y = -100f; } fillCone(buff, x, y); }