mirror of
https://github.com/Insality/druid
synced 2025-09-28 02:22:19 +02:00
Add on layout change initial support
This commit is contained in:
@@ -32,7 +32,7 @@ local const = require("druid.const")
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
local M = component.create("scroll", { const.ON_UPDATE })
|
||||
local M = component.create("scroll", { const.ON_UPDATE, const.ON_LAYOUT_CHANGE })
|
||||
|
||||
|
||||
local function inverse_lerp(min, max, current)
|
||||
@@ -376,6 +376,11 @@ function M.init(self, view_node, content_node)
|
||||
end
|
||||
|
||||
|
||||
function M.on_layout_change(self)
|
||||
gui.set_position(self.content_node, self.position)
|
||||
end
|
||||
|
||||
|
||||
function M.update(self, dt)
|
||||
if self.drag.is_drag then
|
||||
update_hand_scroll(self, dt)
|
||||
|
Reference in New Issue
Block a user