Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Crash with BeginContextMenuWindow for void space #96

Closed
Avril112113 opened this issue Sep 1, 2021 · 2 comments
Closed

[Bug] Crash with BeginContextMenuWindow for void space #96

Avril112113 opened this issue Sep 1, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Avril112113
Copy link
Contributor

Avril112113 commented Sep 1, 2021

In the wiki, the "Context Menus" example states that "This is placed outside of a BeginWindow/EndWindow call for context menus in the void space.", which no longer works since v0.8.0.

Minimal breaking example:

local Slab = require "Slab.API"

function love.update(dt)
	Slab.Update(dt)

	if Slab.BeginContextMenuWindow() then
		Slab.EndContextMenu()
	end
end

Traceback:

Error: libs/Slab//Internal/UI/Window.lua:143: attempt to perform arithmetic on field 'TitleH' (a nil value)
stack traceback:
        [string "boot.lua"]:777: in function '__sub'
        libs/Slab//Internal/UI/Window.lua:143: in function 'IsMouseHovered'
        libs/Slab//Internal/UI/Menu.lua:310: in function 'BeginContextMenuWindow'
        main.lua:36: in function 'update'
        [string "boot.lua"]:612: in function <[string "boot.lua"]:594>
        [C]: in function 'xpcall'
@Avril112113 Avril112113 changed the title Crash with BeginContextMenuWindow for void space [Bug] Crash with BeginContextMenuWindow for void space Sep 1, 2021
@flamendless
Copy link
Owner

Indeed. Idk if i should just edit the wiki and remove that claim haha just kidding. Fix is coming soon

@flamendless flamendless added the bug Something isn't working label Sep 2, 2021
@flamendless
Copy link
Owner

flamendless commented Sep 2, 2021

@Dude112113 this bug has been patched in the latest commit. Do note that you need items between the BeginContextMenuWindow and EndContextMenuWindow call to actually see it. No items will technically not show any context menu because there is nothing to render, therefore no height, therefore no window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants