Bound hitbox showcases x axis on dragging

This commit is contained in:
sector-a
2025-04-17 12:07:03 +03:00
committed by KarimAkra
parent 75e0992509
commit 2f6e6ef7cd
@@ -370,6 +370,9 @@ class ControlsSchemeMenu extends MusicBeatSubState
final showcasesTargetX:Float = originX + dragDistance * 10;
hitboxShowcases.x = MathUtil.smoothLerp(hitboxShowcases.x, showcasesTargetX, elapsed, 0.5);
final minShowcasesX:Float = -1500 * availableSchemes.length;
hitboxShowcases.x = FlxMath.bound(hitboxShowcases.x, minShowcasesX, 400);
final targetIndex:Int = Math.round(hitboxShowcases.x / -1500);
if (currentIndex != targetIndex) setSelection(targetIndex);
}