Fix orientation prop in Progress

This commit is contained in:
Gabriel Tofvesson 2024-10-11 23:18:19 +02:00
parent 4071e380b1
commit 658b69dbf8

View File

@ -1,4 +1,5 @@
local Element = require("gfx.element") local Element = require("gfx.element")
local Prop = require("gfx.prop")
local Orientation = require("gfx.prop.orientation") local Orientation = require("gfx.prop.orientation")
local BlankElement = Element:new() local BlankElement = Element:new()
@ -15,11 +16,11 @@ local function round(value, biasDown)
return (((not biasDown) and decimal < 0.5) or ((not not biasDown) and decimal <= 0.5)) and math.floor(value) or math.ceil(value) return (((not biasDown) and decimal < 0.5) or ((not not biasDown) and decimal <= 0.5)) and math.floor(value) or math.ceil(value)
end end
local Progress = Orientation.with(Element:new{ local Progress = Prop.attach(Element:new{
progress = 0.0, progress = 0.0,
active = nil, active = nil,
inactive = nil inactive = nil
}) }, Orientation, Orientation.VERTICAL)
function Progress:new(o) function Progress:new(o)
local obj = o or {} local obj = o or {}