Small optimization && refactoring

This commit is contained in:
Insality
2023-07-15 15:56:06 +03:00
parent 337090e74c
commit 556e1a9bae
11 changed files with 33 additions and 46 deletions

View File

@@ -123,7 +123,7 @@ end
function Input.init(self, click_node, text_node, keyboard_type)
self.druid = self:get_druid(self)
if type(text_node) == const.TABLE then
if type(text_node) == "table" then
self.text = text_node
else
self.text = self.druid:new_text(text_node)

View File

@@ -120,11 +120,7 @@ function Swipe.on_input(self, action_id, action)
return false
end
local is_pick = gui.pick_node(self.node, action.x, action.y)
if self.click_zone then
is_pick = is_pick and gui.pick_node(self.click_zone, action.x, action.y)
end
local is_pick = helper.pick_node(self.node, action.x, action.y, self.click_zone)
if not is_pick then
reset_swipe(self, action)
return false