add preventSustainClip (#856)

This commit is contained in:
sillyborja
2025-12-19 08:16:59 +07:00
committed by GitHub
parent e585de7db5
commit e6f1fed96e
4 changed files with 16 additions and 3 deletions
+3 -1
View File
@@ -83,6 +83,7 @@ class Note extends FlxSprite
public var sustainLength:Float = 0;
public var isSustainNote:Bool = false;
public var noSustainClip:Bool = false;
public var flipSustain:Bool = true;
public var noteTypeID:Int = 0;
@@ -222,6 +223,7 @@ class Note extends FlxSprite
public var lastScrollSpeed:Null<Float> = null;
public var gapFix:SingleOrFloat = 0;
public var useAntialiasingFix(get, set):Bool;
inline function set_useAntialiasingFix(v:Bool) {
if(v != useAntialiasingFix) {
gapFix = v ? 1 : 0;
@@ -308,7 +310,7 @@ class Note extends FlxSprite
updateSustainClip();
}
public function updateSustainClip() if (wasGoodHit) {
public function updateSustainClip() if (wasGoodHit && !noSustainClip) {
var t = FlxMath.bound((Conductor.songPosition - strumTime) / height * 0.45 * lastScrollSpeed, 0, 1);
var rect = clipRect == null ? FlxRect.get() : clipRect;
clipRect = rect.set(0, frameHeight * t, frameWidth, frameHeight * (1 - t));