mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Update examples, fix scroll params
This commit is contained in:
parent
f8458f8554
commit
077a84d7b1
@ -175,7 +175,8 @@ end
|
||||
|
||||
|
||||
function Scroll.update(self, dt)
|
||||
self:_update_params(dt)
|
||||
self:_update_params()
|
||||
|
||||
if self.drag.is_drag then
|
||||
self:_update_hand_scroll(dt)
|
||||
else
|
||||
@ -525,6 +526,7 @@ function Scroll._set_scroll_position(self, position)
|
||||
if self.position.x ~= position.x or self.position.y ~= position.y then
|
||||
self.position.x = position.x
|
||||
self.position.y = position.y
|
||||
self:_update_params()
|
||||
gui.set_position(self.content_node, position)
|
||||
|
||||
self.on_scroll:trigger(self:get_context(), self.position)
|
||||
@ -688,10 +690,11 @@ function Scroll._update_size(self)
|
||||
|
||||
self.available_pos_extra = get_border_vector(view_border - content_border_extra, self._offset)
|
||||
self.available_size_extra = get_size_vector(self.available_pos_extra)
|
||||
self:_update_params()
|
||||
end
|
||||
|
||||
|
||||
function Scroll._update_params(self, dt)
|
||||
function Scroll._update_params(self)
|
||||
local t = self.target_position
|
||||
local b = self.available_pos
|
||||
|
||||
|
@ -391,7 +391,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_BOX
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
texture: "kenney/back_blue"
|
||||
texture: "kenney/back_green"
|
||||
id: "icon"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
|
@ -41,7 +41,10 @@ function init(self)
|
||||
self.scroll = self.druid:new_scroll("data_list_view", "data_list_content")
|
||||
self.scroll:set_horizontal_scroll(false)
|
||||
self.grid = self.druid:new_static_grid("data_list_content", "prefab", 1)
|
||||
|
||||
-- Pass already created scroll and grid components to data_list:
|
||||
self.data_list = self.druid:new_data_list(self.scroll, self.grid, create_function)
|
||||
|
||||
self.data_list:set_data(data)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user