sus cliprect frameWidth / Height

This commit is contained in:
MtH 2021-04-15 04:24:32 +02:00
parent 806efe6a17
commit e283614258
1 changed files with 4 additions and 4 deletions

View File

@ -2138,16 +2138,16 @@ class PlayState extends MusicBeatState
if (daNote.animation.curAnim.name.endsWith("end") && daNote.prevNote != null) if (daNote.animation.curAnim.name.endsWith("end") && daNote.prevNote != null)
daNote.y += daNote.prevNote.height; daNote.y += daNote.prevNote.height;
else else
daNote.y += daNote.height / daNote.scale.y; daNote.y += daNote.height / 2;
if ((!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit))) if ((!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))
&& daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= strumLineMid) && daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= strumLineMid)
{ {
// div by scale because cliprect is affected by scale i THINK // clipRect is applied to graphic itself so use frame Heights
var swagRect:FlxRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y); var swagRect:FlxRect = new FlxRect(0, 0, daNote.frameWidth, daNote.frameHeight);
swagRect.height = (strumLineMid - daNote.y) / daNote.scale.y; swagRect.height = (strumLineMid - daNote.y) / daNote.scale.y;
swagRect.y = daNote.height / daNote.scale.y - swagRect.height; swagRect.y = daNote.frameHeight - swagRect.height;
daNote.clipRect = swagRect; daNote.clipRect = swagRect;
} }
} }