mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
Add on layout change initial support
This commit is contained in:
@@ -20,7 +20,7 @@ local const = require("druid.const")
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
local M = component.create("progress", { const.ON_UPDATE })
|
||||
local M = component.create("progress", { const.ON_UPDATE, const.ON_LAYOUT_CHANGE })
|
||||
|
||||
|
||||
local function check_steps(self, from, to, exactly)
|
||||
@@ -106,6 +106,11 @@ function M.init(self, node, key, init_value)
|
||||
end
|
||||
|
||||
|
||||
function M.on_layout_change(self)
|
||||
self:set_to(self.last_value)
|
||||
end
|
||||
|
||||
|
||||
function M.update(self, dt)
|
||||
if self.target then
|
||||
local prev_value = self.last_value
|
||||
|
Reference in New Issue
Block a user