Merge branch 'develop' into tests

This commit is contained in:
Insality
2023-02-07 18:45:35 +02:00
27 changed files with 1751 additions and 41 deletions

View File

@@ -61,7 +61,7 @@ local Button = component.create("button")
local function is_input_match(self, action_id)
if action_id == const.ACTION_TOUCH then
if action_id == const.ACTION_TOUCH or action_id == const.ACTION_MULTITOUCH then
return true
end

View File

@@ -5,10 +5,10 @@
-- @within BaseComponent
-- @alias druid.hover
--- On hover callback(self, state)
--- On hover callback(self, state, hover_instance)
-- @tfield DruidEvent on_hover @{DruidEvent}
--- On mouse hover callback(self, state)
--- On mouse hover callback(self, state, hover_instance)
-- @tfield DruidEvent on_mouse_hover @{DruidEvent}
---
@@ -81,6 +81,8 @@ function Hover.on_input(self, action_id, action)
else
hover_function(self, true)
end
return false
end
@@ -95,7 +97,7 @@ end
function Hover.set_hover(self, state)
if self._is_hovered ~= state then
self._is_hovered = state
self.on_hover:trigger(self:get_context(), state)
self.on_hover:trigger(self:get_context(), state, self)
end
end
@@ -114,7 +116,7 @@ end
function Hover.set_mouse_hover(self, state)
if self._is_mouse_hovered ~= state then
self._is_mouse_hovered = state
self.on_mouse_hover:trigger(self:get_context(), state)
self.on_mouse_hover:trigger(self:get_context(), state, self)
end
end

View File

@@ -10,7 +10,7 @@
--- On set text callback(self, text)
-- @tfield DruidEvent on_set_text @{DruidEvent}
--- On adjust text size callback(self, new_scale)
--- On adjust text size callback(self, new_scale, text_metrics)
-- @tfield DruidEvent on_update_text_scale @{DruidEvent}
--- On change pivot callback(self, pivot)
@@ -100,7 +100,7 @@ local function update_text_area_size(self)
update_text_size(self)
self.on_update_text_scale:trigger(self:get_context(), new_scale)
self.on_update_text_scale:trigger(self:get_context(), new_scale, metrics)
end