div_end returns the div Id

This commit is contained in:
Alessandro Mauri 2025-09-12 22:45:23 +02:00
parent d35ef7ddaf
commit 81cc3dae65

View File

@ -32,7 +32,7 @@ macro Ctx.@div(&ctx,
{
ctx.div_begin(width, height, dir, anchor, scroll_x, scroll_y, $vasplat)!;
@body();
ctx.div_end()!;
return ctx.div_end()!;
}
macro Ctx.div_begin(&ctx,
@ -92,7 +92,7 @@ fn void? Ctx.div_begin_id(&ctx,
// TODO: check resizeable
}
fn void? Ctx.div_end(&ctx)
fn Id? Ctx.div_end(&ctx)
{
Elem* elem = ctx.get_active_div()!;
@ -136,4 +136,6 @@ fn void? Ctx.div_end(&ctx)
ctx.reset_scissor(elem.div.z_index)!;
update_parent_size(elem, parent);
return elem.id;
}