From a4ebbc26795298e0e08274c6687eb9ee8f45664c Mon Sep 17 00:00:00 2001 From: Kyle McLamb Date: Tue, 4 Oct 2016 16:20:32 -0700 Subject: [PATCH] Fix bug with layout left()/up() When moving down/right, we use the old cell size because we are moving the start point outside of the existing cell. When we go up/right, we are doing actually doing the inverse operation, moving backwards using the new cell size. We still check to see if there's an old cell because up()/down()/left()/right() should behave the same for the first cell. --- layout.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout.lua b/layout.lua index 58c7034..f84fdd6 100644 --- a/layout.lua +++ b/layout.lua @@ -152,7 +152,7 @@ Layout.down = Layout.row function Layout:up(w, h) w,h = calc_width_height(self, w, h) - local x,y = self._x, self._y - (self._h or 0) + local x,y = self._x, self._y - (self._h and h or 0) if not self._isFirstCell then y = y - self._pady @@ -184,7 +184,7 @@ Layout.right = Layout.col function Layout:left(w, h) w,h = calc_width_height(self, w, h) - local x,y = self._x - (self._w or 0), self._y + local x,y = self._x - (self._w and w or 0), self._y if not self._isFirstCell then x = x - self._padx