Fix drag getting stuck to cursor on release, bump to 1.2

OnMouseUp only fires while the cursor is still over the frame at the
instant the button is released, which a quick flick of this small
frame easily misses, leaving it stuck following the mouse forever.
OnUpdate now polls IsMouseButtonDown every frame and stops the drag
as soon as the button is released, independent of cursor position.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
kompolompo
2026-09-05 12:31:35 +02:00
co-authored by Claude Sonnet 5
parent 36be1e9d8e
commit 5e1f373b75
3 changed files with 14 additions and 1 deletions
+9
View File
@@ -94,6 +94,15 @@ local function OctoLatency_UpdateText()
end
function OctoLatency_OnUpdate(elapsed)
-- OnMouseUp only fires while the cursor is still over the frame at
-- release, which a quick flick of this small frame easily misses,
-- leaving it stuck following the cursor forever. Poll the actual
-- button state every frame so it lets go regardless of where the
-- mouse ends up.
if (this.isMoving and not IsMouseButtonDown("LeftButton")) then
OctoLatency_StopMoving(this)
end
elapsedTimer = elapsedTimer + elapsed
if (elapsedTimer < UPDATE_INTERVAL) then
return