Skip to content

Commit 2b7e997

Browse files
committed
fix updating of positions to avoid one-frame glitches
1 parent cd22f8f commit 2b7e997

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

source/online/objects/ChatBox.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ class ChatBox extends FlxTypedSpriteGroup<FlxSprite> {
175175
focused = false; // initial update
176176

177177
y = FlxG.height - height;
178+
179+
update(0);
178180
}
179181

180182
override function destroy() {

source/online/substates/SoFunkinSubstate.hx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ class SoFunkinSubstate extends MusicBeatSubstate {
277277
pressCallback(controls);
278278
}
279279

280+
updateTextsPosition();
281+
}
282+
283+
function updateTextsPosition() {
280284
for (grpIndex => item in grpTexts.members) {
281285
var item:Scrollable = cast(item, Scrollable);
282286
item.x = ((item.targetY - lerpSelected) * item.distancePerItem.x) + item.startPosition.x;
@@ -377,7 +381,6 @@ class SoFunkinSubstate extends MusicBeatSubstate {
377381
final icon = optionsIcons.get(item.ID);
378382
if (icon != null) {
379383
icon.sprTracker = cast item;
380-
icon.snapToTracker();
381384
grpIcons.add(icon);
382385
}
383386
else if (!optionsIcons.exists(item.ID) && futureIndex != item.ID) {
@@ -394,6 +397,19 @@ class SoFunkinSubstate extends MusicBeatSubstate {
394397
}
395398
item.alpha = 0.6;
396399
}
400+
401+
updateTextsPosition();
402+
403+
for (icon in grpIcons) {
404+
icon.snapToTracker();
405+
}
406+
407+
for (icon in grpIconsOverlay) {
408+
icon.update(0);
409+
}
410+
411+
// if (postRenderCallback != null)
412+
// postRenderCallback();
397413
}
398414

399415
function onKeyDown(e:KeyboardEvent) {

source/states/FreeplayState.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,12 @@ class FreeplayState extends MusicBeatState
20032003
}
20042004

20052005
updateSelectSelection();
2006+
2007+
updateTexts(0);
2008+
2009+
for (heart in renderHearts) {
2010+
heart.update(0);
2011+
}
20062012
}
20072013

20082014
inline private function _updateSongLastDifficulty()
@@ -2403,7 +2409,6 @@ class FreeplayState extends MusicBeatState
24032409
}
24042410

24052411
changeSelection();
2406-
updateTexts();
24072412
}
24082413

24092414
var searchInputWait:Bool = false;

0 commit comments

Comments
 (0)