flamendless / Slab

An immediate mode GUI for the Love2D framework.
MIT License
294 stars 25 forks source link

BeginTree does not return boolean properly when toggled close/open #90

Closed flamendless closed 3 years ago

flamendless commented 3 years ago

for Slab.Windows this works:

--load
local flags = {is_open = true}

--update
flags.is_open = Slab.BeginWindow("window", {Title = "Window", IsOpen = flags.is_open})
--draw
Slab.EndWindow()

opening/closing the window works

but for Slab.BeginTree it does not, even clicking on the tree arrow, it does not toggle open/close

for Slab.Windows this works:
```lua
--load
local flags = {is_open = true}

--update
flags.is_open = Slab.BeginTree("tree", {Title = "Tree", IsOpen = flags.is_open})
print(flags.is_open) --always true
--draw
Slab.EndTree()
flamendless commented 3 years ago

Fixed in f71d42bb1dc45c22b10e5a0291273f4d2412711b