From f1e0807d302174fcec115e5c559d28b1de17849d Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 24 Jan 2023 22:41:36 +0100 Subject: lua: hstack/vstack allow "none" alignment of elements --- lua-bindings/diaphragm.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua-bindings/diaphragm.lua b/lua-bindings/diaphragm.lua index 8632e51..a308c28 100644 --- a/lua-bindings/diaphragm.lua +++ b/lua-bindings/diaphragm.lua @@ -296,7 +296,10 @@ function M.layout.hstack(params) local el_vert_anchor = el[self.align] M.constrain(el.left:eq(previous_right + self.spacing)) - M.constrain(el_vert_anchor:eq(previous_vert_anchor)) + + if self.align ~= "none" then + M.constrain(el_vert_anchor:eq(previous_vert_anchor)) + end table.insert(tops, el.top) table.insert(bottoms, el.bottom) @@ -338,7 +341,10 @@ function M.layout.vstack(params) local el_horiz_anchor = el[self.align] M.constrain(el.top:eq(previous_bottom + self.spacing)) - M.constrain(el_horiz_anchor:eq(previous_horiz_anchor)) + + if self.align ~= "none" then + M.constrain(el_horiz_anchor:eq(previous_horiz_anchor)) + end table.insert(lefts, el.left) table.insert(rights, el.right) -- cgit v1.2.3