Skip to content

Commit 727482f

Browse files
committed
fix: changed wrap.snap checks to ~= 0 to make the code clearer
1 parent 4058d94 commit 727482f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

external/script/main.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,7 @@ function main.f_menuCommonCalc(t, item, cursorPosY, moveTxt, sec, cursorParams,
32123212
item = item + 1
32133213
end
32143214
cursorPosY = item
3215-
if sec.menu.tween.wrap.snap == 1 then
3215+
if sec.menu.tween.wrap.snap ~= 0 then
32163216
main.menuSnap = true
32173217
end
32183218
main.menuWrapped = true
@@ -3227,7 +3227,7 @@ function main.f_menuCommonCalc(t, item, cursorPosY, moveTxt, sec, cursorParams,
32273227
else
32283228
cursorPosY = item
32293229
end
3230-
if sec.menu.tween.wrap.snap == 1 then
3230+
if sec.menu.tween.wrap.snap ~= 0 then
32313231
main.menuSnap = true
32323232
end
32333233
main.menuWrapped = true
@@ -3422,7 +3422,7 @@ function main.f_menuCommonDraw(t, item, cursorPosY, moveTxt, sec, bg, skipClear,
34223422
sec.boxCursorData.init = true
34233423
sec.boxCursorData.snap = -1
34243424
end
3425-
if sec.menu.boxcursor.tween.wrap.snap == 1 and main.menuWrapped then
3425+
if sec.menu.boxcursor.tween.wrap.snap ~= 0 and main.menuWrapped then
34263426
sec.boxCursorData.offsetY = targetY
34273427
end
34283428
--apply tween if enabled, otherwise snap to target

external/script/start.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ function start.f_drawCursor(pn, x, y, param, done)
10921092
cd.slideOffset[1], cd.slideOffset[2] = 0, 0
10931093
end
10941094

1095-
if motif.select_info['p' .. pn].cursor.tween.wrap.snap == 1 then
1095+
if motif.select_info['p' .. pn].cursor.tween.wrap.snap ~= 0 then
10961096
local dx = cd.targetPos[1] - cd.startPos[1]
10971097
local dy = cd.targetPos[2] - cd.startPos[2]
10981098
if math.abs(dx) > motif.select_info.cell.size[1] * (motif.select_info.columns - 1) or math.abs(dy) > motif.select_info.cell.size[2] * (motif.select_info.rows - 1) then

0 commit comments

Comments
 (0)