Skip to content

Commit 54465e6

Browse files
committed
fix: apply lag compensation in fullscreen scrollbar appear animation
1 parent 9206595 commit 54465e6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/control_draw/control_draw.gml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,15 +1244,15 @@ function control_draw() {
12441244
} else {
12451245
// horizontal rise animation
12461246
if (mouse_rectangle(0, rh - 25, rw, rh)) {
1247-
if (window = 0 && sbh_anim < 16) sbh_anim += (2 * 30 / room_speed)
1247+
if (window = 0 && sbh_anim < 16) sbh_anim += (2 * 30 / room_speed) * (1 / currspeed)
12481248
} else if (sb_drag = -1) {
1249-
if (sbh_anim > 0) sbh_anim -= (2 * 30 / room_speed)
1249+
if (sbh_anim > 0) sbh_anim -= (2 * 30 / room_speed) * (1 / currspeed)
12501250
}
12511251
// vertical rise animation
12521252
if (mouse_rectangle(rw - 25, 0, rw, rh)) {
1253-
if (window = 0 && sbv_anim < 16) sbv_anim += (2 * 30 / room_speed)
1253+
if (window = 0 && sbv_anim < 16) sbv_anim += (2 * 30 / room_speed) * (1 / currspeed)
12541254
} else if (sb_drag = -1) {
1255-
if (sbv_anim > 0) sbv_anim -= (2 * 30 / room_speed)
1255+
if (sbv_anim > 0) sbv_anim -= (2 * 30 / room_speed) * (1 / currspeed)
12561256
}
12571257
starta = draw_scrollbar(scrollbarh, 0, rh - sbh_anim, 32, ((rw - 16) / 32) - 1, enda + totalcols - 2, (exist && changepitch) || mousewheel > 0, 0)
12581258
startb = draw_scrollbar(scrollbarv, rw - sbv_anim, rhval, 32, ((rh - rhval - 16) / 32) - 1, endb + totalrows - 2, (exist && changepitch) || mousewheel > 0, 0)

0 commit comments

Comments
 (0)