aboutsummaryrefslogtreecommitdiff
path: root/src/gui/inc
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-07-10 00:21:09 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-07-10 00:26:48 +0200
commitf69dc6f359015e992d181c60cd815cefd6c62aad (patch)
tree67e47e8862884f6e66b5bb745ff0b964c93a9124 /src/gui/inc
parentf318a66f8ccc847bd9940d125936aa87df74fb0f (diff)
downloadjancity-f69dc6f359015e992d181c60cd815cefd6c62aad.tar.gz
Allow children of gui_container be resized anytime
So far, their position inside the container was determined when initializing the interface. However, if a child were resized afterwards, the container would not adjust its elements accordingly. Moreover, the implementation for gui_container relied on hacking the children's X/Y coordinates, which could only be done once. Now, two additional members have been added to gui_common so that specific X/Y offset can be determined by the parent, additionally to the traditional rules followed by gui_coords. Despite the extra memory footprint, it now allows containers to set specific X/Y offsets for their children on every game cycle.
Diffstat (limited to 'src/gui/inc')
-rw-r--r--src/gui/inc/gui.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/inc/gui.h b/src/gui/inc/gui.h
index 18ed37b..84a6c66 100644
--- a/src/gui/inc/gui.h
+++ b/src/gui/inc/gui.h
@@ -21,7 +21,7 @@ struct gui_common
void (*get_dim)(const struct gui_common *, short *w, short *h);
} *cb;
- short x, y;
+ short x, y, xoff, yoff;
bool hcentered, vcentered;
struct gui_common *parent, *child, *sibling;
};