summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 71539fa0..36fd91eb 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -484,7 +484,10 @@ iWidget *makeSheet_Widget(const char *id) {
484void centerSheet_Widget(iWidget *sheet) { 484void centerSheet_Widget(iWidget *sheet) {
485 arrange_Widget(sheet); 485 arrange_Widget(sheet);
486 const iInt2 rootSize = rootSize_Window(get_Window()); 486 const iInt2 rootSize = rootSize_Window(get_Window());
487 sheet->rect.pos.x = rootSize.x / 2 - sheet->rect.size.x / 2; 487 const iInt2 orig = localCoord_Widget(
488 sheet->parent,
489 init_I2(rootSize.x / 2 - sheet->rect.size.x / 2, bounds_Widget(sheet).pos.y));
490 sheet->rect.pos = orig;
488 postRefresh_App(); 491 postRefresh_App();
489} 492}
490 493