From ad9e85b8d407673cc9329e54a44cec10fdf7c285 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 9 Jul 2023 11:49:05 +0900 Subject: [PATCH] [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. --- include/QF/ui/canvas.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/QF/ui/canvas.h b/include/QF/ui/canvas.h index 128a4fcbb..a25d5a9dc 100644 --- a/include/QF/ui/canvas.h +++ b/include/QF/ui/canvas.h @@ -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