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.
This commit is contained in:
Kyle McLamb 2016-10-04 16:20:32 -07:00
parent 549693dd38
commit a4ebbc2679

View file

@ -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