mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
#124 Add set_click_zone to scroll component
This commit is contained in:
parent
fe3ac2e985
commit
7c79985be6
@ -139,3 +139,4 @@ Desc
|
|||||||
- Input component: rename field _selected_ to _is_selected_ (according to the docs)
|
- Input component: rename field _selected_ to _is_selected_ (according to the docs)
|
||||||
- Add EmmyLua annotations. See how to use it FAQ
|
- Add EmmyLua annotations. See how to use it FAQ
|
||||||
- Lang text now can be initialized without default locale id
|
- Lang text now can be initialized without default locale id
|
||||||
|
- **#124** Add _set_click_zone_ functon to Scroll component (just link to Drag:set_click_zone inside scroll component)
|
||||||
|
@ -263,9 +263,9 @@ end
|
|||||||
--- Strict drag click area. Useful for
|
--- Strict drag click area. Useful for
|
||||||
-- restrict events outside stencil node
|
-- restrict events outside stencil node
|
||||||
-- @tparam Drag self
|
-- @tparam Drag self
|
||||||
-- @tparam node zone Gui node
|
-- @tparam node node Gui node
|
||||||
function Drag.set_click_zone(self, zone)
|
function Drag.set_click_zone(self, node)
|
||||||
self.click_zone = self:get_node(zone)
|
self.click_zone = self:get_node(node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,6 +379,15 @@ function Scroll.bind_grid(self, grid)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Strict drag scroll area. Useful for
|
||||||
|
-- restrict events outside stencil node
|
||||||
|
-- @tparam Drag self
|
||||||
|
-- @tparam node node Gui node
|
||||||
|
function Scroll.set_click_zone(self, node)
|
||||||
|
self.drag:set_click_zone(node)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function Scroll._on_scroll_drag(self, dx, dy)
|
function Scroll._on_scroll_drag(self, dx, dy)
|
||||||
local t = self.target_position
|
local t = self.target_position
|
||||||
local b = self.available_pos
|
local b = self.available_pos
|
||||||
|
Loading…
x
Reference in New Issue
Block a user