mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Add asserts to begin_window and begin_panel
This commit is contained in:
Vendored
+2
@@ -1279,6 +1279,7 @@ end_root_container :: proc(ctx: ^Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
begin_window :: proc(ctx: ^Context, title: string, rect: Rect, opt := Options{}) -> bool {
|
begin_window :: proc(ctx: ^Context, title: string, rect: Rect, opt := Options{}) -> bool {
|
||||||
|
assert(title != "", "missing window title")
|
||||||
id := get_id(ctx, title)
|
id := get_id(ctx, title)
|
||||||
cnt := internal_get_container(ctx, id, opt)
|
cnt := internal_get_container(ctx, id, opt)
|
||||||
if cnt == nil || !cnt.open {
|
if cnt == nil || !cnt.open {
|
||||||
@@ -1415,6 +1416,7 @@ scoped_end_popup :: proc(ctx: ^Context, _: string, ok: bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
begin_panel :: proc(ctx: ^Context, name: string, opt := Options{}) {
|
begin_panel :: proc(ctx: ^Context, name: string, opt := Options{}) {
|
||||||
|
assert(name != "", "missing panel name")
|
||||||
push_id(ctx, name)
|
push_id(ctx, name)
|
||||||
cnt := internal_get_container(ctx, ctx.last_id, opt)
|
cnt := internal_get_container(ctx, ctx.last_id, opt)
|
||||||
cnt.rect = layout_next(ctx)
|
cnt.rect = layout_next(ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user