From ab26c62e85c9adc5fa22505278dd068406e6aaf6 Mon Sep 17 00:00:00 2001 From: Fox Date: Fri, 22 Jan 2016 09:01:28 -0800 Subject: [PATCH] adjustSize() args optional, text font set to 14 by default --- pop/elements/element.lua | 10 +++++++++- pop/elements/text.lua | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pop/elements/element.lua b/pop/elements/element.lua index 3201841..3b0be75 100644 --- a/pop/elements/element.lua +++ b/pop/elements/element.lua @@ -105,7 +105,15 @@ end function element:adjustSize(x, y) local X, Y = self:getSize() - self:setSize(X + x, Y + y) + + if x then + X = X + x + end + if y then + Y = Y + y + end + + self:setSize(X, Y) return self end diff --git a/pop/elements/text.lua b/pop/elements/text.lua index f581a49..90c229a 100644 --- a/pop/elements/text.lua +++ b/pop/elements/text.lua @@ -9,7 +9,7 @@ local text = class("pop.text", element) function text:initialize(pop, parent, text, color) element.initialize(self, pop, parent) - self.font = lg.newFont() + self.font = lg.newFont(14) self:setText(text or "") self.color = color or {255, 255, 255, 255} end