flamendless / Slab

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

Main Menu interferes with window dragging #164

Closed akkartik closed 10 months ago

akkartik commented 10 months ago

Here's the example from the Slab Readme, just with a main menu bar:

local Slab = require "Slab"

function love.load(args)
        Slab.Initialize(args)
end

function love.update(dt)
        Slab.Update(dt)
        if Slab.BeginMainMenuBar() then
                Slab.EndMainMenuBar()
        end
        Slab.BeginWindow("MyFirstWindow",{Title = "My First Window"})
        Slab.Text("Hello World")
        Slab.EndWindow()
end

function love.draw()
        Slab.Draw()
end

The window can be dragged anywhere on screen before, but with the addition of the menu, its y coordinate snaps back when you stop dragging.

Workaround: moving the menu configuration to the end of function.

flamendless commented 10 months ago

Hi @akkartik this should be fixed now with the latest commit

akkartik commented 10 months ago

Confirmed! Thank you.