fix column width bug in SimpleWindow

This commit is contained in:
2022-09-11 21:17:33 +00:00
parent 78f7b5ca00
commit f9fbe86a19

View File

@@ -69,16 +69,14 @@
(+= nextControlY control.height) (+= nextControlY control.height)
// TODO controls that aren't the same height as text will be able to vertically overflow // TODO controls that aren't the same height as text will be able to vertically overflow
(let [columnControls (controls.members.slice (if title 1 0))] (let [columnControls (controls.members.slice (if title 1 0))]
(if (and columnControls (= 0 (% columnControls.length controlsPerColumn))) (setNth columnWidths -1 (max (+ control.width textSize) (last columnWidths)))
{ (when (and columnControls (= 0 (% columnControls.length controlsPerColumn)))
(set nextControlY 0) (set nextControlY 0)
(when title (+= nextControlY control.height)) (when title (+= nextControlY control.height))
(+= nextControlX (last columnWidths)) (+= nextControlX (last columnWidths))
(columnWidths.push (+ control.width textSize)) (columnWidths.push 0)
(when (> (apply + columnWidths) width) (when (> (apply + columnWidths) width)
(makeScrollArrows)) (makeScrollArrows))))
}
(setNth columnWidths -1 (max (+ control.width textSize) (last columnWidths)))))
control) control)
(prop &mut :FlxText leftText) (prop &mut :FlxText leftText)