Fix column width bug
This commit is contained in:
@@ -69,16 +69,17 @@
|
|||||||
(+= 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))]
|
||||||
(when (and columnControls (= 0 (% columnControls.length controlsPerColumn)))
|
(if (and columnControls (= 0 (% columnControls.length controlsPerColumn)))
|
||||||
(set nextControlY 0)
|
{
|
||||||
(when title (+= nextControlY control.height))
|
(set nextControlY 0)
|
||||||
(let [lastColumnWidth (+ textSize (apply max
|
(when title (+= nextControlY control.height))
|
||||||
(for control (last (groups columnControls controlsPerColumn))
|
(+= nextControlX (last columnWidths))
|
||||||
control.width)))]
|
(columnWidths.push (+ control.width textSize))
|
||||||
(columnWidths.push lastColumnWidth)
|
(when (> (apply + columnWidths) width)
|
||||||
(when (> (apply + columnWidths) width)
|
(makeScrollArrows))
|
||||||
(makeScrollArrows))
|
}
|
||||||
(+= nextControlX lastColumnWidth)))))
|
(setNth columnWidths -1 (max (+ control.width textSize) (last columnWidths)))))
|
||||||
|
control)
|
||||||
|
|
||||||
(prop &mut :FlxText leftText)
|
(prop &mut :FlxText leftText)
|
||||||
(prop &mut :FlxText rightText)
|
(prop &mut :FlxText rightText)
|
||||||
@@ -123,12 +124,12 @@
|
|||||||
(prop &mut _shown false)
|
(prop &mut _shown false)
|
||||||
(method isShown [] _shown)
|
(method isShown [] _shown)
|
||||||
|
|
||||||
(prop &mut :Array<Float> columnWidths [])
|
(prop &mut :kiss.List<Float> columnWidths [0.0])
|
||||||
(prop &mut cameraColumn 0)
|
(prop &mut cameraColumn 0)
|
||||||
(prop &mut hasScrollArrows false)
|
(prop &mut hasScrollArrows false)
|
||||||
|
|
||||||
(method clearControls []
|
(method clearControls []
|
||||||
(set columnWidths [])
|
(set columnWidths [0.0])
|
||||||
(set hasScrollArrows false)
|
(set hasScrollArrows false)
|
||||||
(_actions.clear)
|
(_actions.clear)
|
||||||
(controls.clear)
|
(controls.clear)
|
||||||
|
Reference in New Issue
Block a user