From 083a642ab3df81d49116f7c22e20cd911e87c46a Mon Sep 17 00:00:00 2001 From: "Squishy (C6H12O6+NaCl+H2O)" <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Tue, 21 May 2024 23:43:55 +0700 Subject: [PATCH] TEST --- libs/simple-button.lua | 2 +- scene/touch_config.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/simple-button.lua b/libs/simple-button.lua index ce0498c..45a0c1d 100644 --- a/libs/simple-button.lua +++ b/libs/simple-button.lua @@ -120,7 +120,7 @@ function button:press(x, y) end ---Trigger release action, don't need ``self._hovering`` to ``true`` function button:release(x, y) - if self:isHovering(x, y) then + if self:isHovering(x, y) and self._pressed then self._pressed = false self.codeWhenReleased() end diff --git a/scene/touch_config.lua b/scene/touch_config.lua index 9b22b4a..be744dc 100644 --- a/scene/touch_config.lua +++ b/scene/touch_config.lua @@ -83,7 +83,7 @@ function TouchConfigScene:onInputPress(e) end ---@param e SCENE_onInput function TouchConfigScene:onInputRelease(e) - if e.type == "mouse" or e.type == "touch" then + if e.x and e.y then BUTTON.release(buttonList, e.x, e.y) end end