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
commite636accfd5b310165c0d7b5075f89a64583b5f1a (patch)
tree0fd80ee1c9fad53f8193d5312b1d7f3c6721f39f /src/gui/inc
parent08951d4af59a8e8c6f760453bc84f59ee8fc157c (diff)
downloadrts-e636accfd5b310165c0d7b5075f89a64583b5f1a.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;
};