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:
co-authored by
Claude Sonnet 5
parent
36be1e9d8e
commit
5e1f373b75
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user