diff --git a/docs_md/changelog.md b/docs_md/changelog.md index 832edd1..e2fc054 100644 --- a/docs_md/changelog.md +++ b/docs_md/changelog.md @@ -139,3 +139,4 @@ Desc - Input component: rename field _selected_ to _is_selected_ (according to the docs) - Add EmmyLua annotations. See how to use it FAQ - 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) diff --git a/druid/base/drag.lua b/druid/base/drag.lua index 8632929..9263e29 100644 --- a/druid/base/drag.lua +++ b/druid/base/drag.lua @@ -263,9 +263,9 @@ end --- Strict drag click area. Useful for -- restrict events outside stencil node -- @tparam Drag self --- @tparam node zone Gui node -function Drag.set_click_zone(self, zone) - self.click_zone = self:get_node(zone) +-- @tparam node node Gui node +function Drag.set_click_zone(self, node) + self.click_zone = self:get_node(node) end diff --git a/druid/base/scroll.lua b/druid/base/scroll.lua index 4c532ca..c7681ae 100644 --- a/druid/base/scroll.lua +++ b/druid/base/scroll.lua @@ -379,6 +379,15 @@ function Scroll.bind_grid(self, grid) 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) local t = self.target_position local b = self.available_pos