layout: add newRow function, which increments the layout y position by the current cell height, while resetting the x position and internal width

This commit is contained in:
len0rd 2025-08-04 21:34:36 -04:00
parent 28abbc8bd1
commit 2634383ffd

View file

@ -15,6 +15,7 @@ function Layout:reset(x,y, padx,pady)
self._widths = {} self._widths = {}
self._heights = {} self._heights = {}
self._isFirstCell = true self._isFirstCell = true
self._start_x = self._x
return self return self
end end
@ -35,6 +36,12 @@ function Layout:nextRow()
return self._x, self._y + self._h + self._pady return self._x, self._y + self._h + self._pady
end end
function Layout:newRow()
self._x = self._start_x
self._y = self._y + self._h + self._pady
self._w = nil
end
Layout.nextDown = Layout.nextRow Layout.nextDown = Layout.nextRow
function Layout:nextCol() function Layout:nextCol()