[ui] Access the canvas visibility flag safely

That wasn't so well thought out as adding fields before the flag made
for some rather interesting behavior.
This commit is contained in:
Bill Currie 2023-07-09 11:49:05 +09:00
parent bf05da26cc
commit ad9e85b8d4

View file

@ -116,7 +116,8 @@ bool *
Canvas_Visible (canvas_system_t canvas_sys, uint32_t ent)
{
uint32_t comp = canvas_sys.base + canvas_canvas;
return Ent_GetComponent (ent, comp, canvas_sys.reg);
auto canvas = (canvas_t *) Ent_GetComponent (ent, comp, canvas_sys.reg);
return &canvas->visible;
}
#undef CANVASINLINE