From a483a319e623f4ac9e81b937b54a0335bb7c75d2 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Fri, 11 Oct 2024 23:27:02 +0200 Subject: [PATCH] Pass args to resize() by name --- gfx/progress.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/gfx/progress.lua b/gfx/progress.lua index d138680..00969df 100644 --- a/gfx/progress.lua +++ b/gfx/progress.lua @@ -32,12 +32,24 @@ end function Progress:_updateProgress() local width, height = self:getWidth(), self:getHeight() if self:isVertical() then - self.active:resize(width, round(self:getProgress() * height)) - self.inactive:resize(width, round((1 - self:getProgress()) * height, true)) + self.active:resize{ + width = width, + height = round(self:getProgress() * height) + } + self.inactive:resize{ + width = width, + height = round((1 - self:getProgress()) * height, true) + } self.inactive:setY(self.active:getY() + self.active:getHeight()) else - self.active:resize(round(self:getProgress() * width), height) - self.active:resize(round((1 - self:getProgress()) * width, true), height) + self.active:resize{ + width = round(self:getProgress() * width), + height = height + } + self.active:resize{ + width = round((1 - self:getProgress()) * width, true), + height = height + } self.inactive:setX(self.active:setX() + self.active:getWidth()) end end