From 35050bf8bbf2ec9d44e744d6fe56127a9ed86cad Mon Sep 17 00:00:00 2001 From: James <36278229+FormularSumo@users.noreply.github.com> Date: Sat, 17 Apr 2021 21:38:26 +0100 Subject: [PATCH] If window width/height provided in push:setupScreem are 0 set them to desktop dimensions --- push.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/push.lua b/push.lua index b22f698..cc46cb0 100644 --- a/push.lua +++ b/push.lua @@ -41,6 +41,15 @@ function push:setupScreen(WWIDTH, WHEIGHT, RWIDTH, RHEIGHT, settings) self._WWIDTH, self._WHEIGHT = WWIDTH, WHEIGHT self._RWIDTH, self._RHEIGHT = RWIDTH, RHEIGHT + + local windowWidth, windowHeight = love.window.getDesktopDimensions() + + if self._RWIDTH == 0 then + self._RWIDTH = windowWidth + end + if self._RHEIGHT == 0 then + self._RHEIGHT = windowHeight + end self:applySettings(self.defaults) --set defaults first self:applySettings(settings) --then fill with custom settings