Fix SimpleWindow control overflow with title
This commit is contained in:
@@ -35,7 +35,8 @@
|
|||||||
|
|
||||||
(let [textHeight
|
(let [textHeight
|
||||||
.height (new FlxText 0 0 0 "a" textSize)]
|
.height (new FlxText 0 0 0 "a" textSize)]
|
||||||
(set controlsPerColumn (Math.floor (/ height textHeight))))
|
(set controlsPerColumn (Math.floor (/ height textHeight)))
|
||||||
|
(when title (-= controlsPerColumn 1)))
|
||||||
|
|
||||||
(when title
|
(when title
|
||||||
(makeText title null))
|
(makeText title null))
|
||||||
@@ -58,12 +59,13 @@
|
|||||||
(controls.add control)
|
(controls.add control)
|
||||||
(+= 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
|
||||||
(when (= 0 (% controls.length controlsPerColumn))
|
(let [columnControls (controls.members.slice (if title 1 0))]
|
||||||
|
(when (and columnControls (= 0 (% columnControls.length controlsPerColumn)))
|
||||||
(set nextControlY y)
|
(set nextControlY y)
|
||||||
(when title (+= nextControlY control.height))
|
(when title (+= nextControlY control.height))
|
||||||
(+= nextControlX (apply max
|
(+= nextControlX (apply max
|
||||||
(for control (last (groups controls.members controlsPerColumn))
|
(for control (last (groups columnControls controlsPerColumn))
|
||||||
control.width)) textSize)))
|
control.width)) textSize))))
|
||||||
|
|
||||||
(prop :Map<FlxSprite,Action> _actions (new Map))
|
(prop :Map<FlxSprite,Action> _actions (new Map))
|
||||||
(prop :Map<FlxSprite,FlxColor> _colors (new Map))
|
(prop :Map<FlxSprite,FlxColor> _colors (new Map))
|
||||||
|
Reference in New Issue
Block a user