diff options
author | Minijackson <minijackson@riseup.net> | 2023-01-24 22:41:36 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2023-01-24 22:41:36 +0100 |
commit | f1e0807d302174fcec115e5c559d28b1de17849d (patch) | |
tree | 6093cbbb7dfb55e2cdcc5f6864112ff10c628632 | |
parent | 24a9ce31acf489b56682efdefed15c10dd4c308a (diff) | |
download | diaphragm-f1e0807d302174fcec115e5c559d28b1de17849d.tar.gz diaphragm-f1e0807d302174fcec115e5c559d28b1de17849d.zip |
lua: hstack/vstack allow "none" alignment of elements
-rw-r--r-- | lua-bindings/diaphragm.lua | 10 |
1 files 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) | |||
296 | local el_vert_anchor = el[self.align] | 296 | local el_vert_anchor = el[self.align] |
297 | 297 | ||
298 | M.constrain(el.left:eq(previous_right + self.spacing)) | 298 | M.constrain(el.left:eq(previous_right + self.spacing)) |
299 | M.constrain(el_vert_anchor:eq(previous_vert_anchor)) | 299 | |
300 | if self.align ~= "none" then | ||
301 | M.constrain(el_vert_anchor:eq(previous_vert_anchor)) | ||
302 | end | ||
300 | 303 | ||
301 | table.insert(tops, el.top) | 304 | table.insert(tops, el.top) |
302 | table.insert(bottoms, el.bottom) | 305 | table.insert(bottoms, el.bottom) |
@@ -338,7 +341,10 @@ function M.layout.vstack(params) | |||
338 | local el_horiz_anchor = el[self.align] | 341 | local el_horiz_anchor = el[self.align] |
339 | 342 | ||
340 | M.constrain(el.top:eq(previous_bottom + self.spacing)) | 343 | M.constrain(el.top:eq(previous_bottom + self.spacing)) |
341 | M.constrain(el_horiz_anchor:eq(previous_horiz_anchor)) | 344 | |
345 | if self.align ~= "none" then | ||
346 | M.constrain(el_horiz_anchor:eq(previous_horiz_anchor)) | ||
347 | end | ||
342 | 348 | ||
343 | table.insert(lefts, el.left) | 349 | table.insert(lefts, el.left) |
344 | table.insert(rights, el.right) | 350 | table.insert(rights, el.right) |