mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Small optimization && refactoring
This commit is contained in:
@@ -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)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user