From 141620d979c2331e898f680bf06218e1ef5b30a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Ritzl?= Date: Sun, 27 Jun 2021 23:25:16 +0200 Subject: [PATCH] Don't discard possible drag event when moving outside draggable object Fixes #20 --- in/cursor.script | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/in/cursor.script b/in/cursor.script index d8c5903..7a044e8 100644 --- a/in/cursor.script +++ b/in/cursor.script @@ -154,9 +154,11 @@ function update(self, dt) -- in both cases we clear pressed and over state and generate an OUT event if self.state.pressed and self.state.pressed_id and not self.collision_id and not self.state.dragging then trigger_event(self, self.state.over_id, self.state.over_group, self.action, cursor.OUT) - clear_pressed_state(self) clear_over_state(self) - clear_drag_state(self) + if not go_exists(self.state.pressed_id) or self.state.dragging_cancelled then + clear_pressed_state(self) + clear_drag_state(self) + end end --