From 26361f2f5aea7d6e7c621235bdbf71e76c87997a Mon Sep 17 00:00:00 2001 From: jmt Date: Mon, 15 Feb 2010 23:34:53 +0000 Subject: [PATCH] Bugfix: stop dialogs jumping around when re-layout occurs - make positions persistent. --- src/GUI/dialog.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index 95fe5f04c..e20a62b93 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -295,8 +295,16 @@ int fgPopup::checkHit(int button, int updown, int x, int y) getFirstChild()->setSize(w, h); // dialog background puFrame } } else { - setPosition(x + _dlgX - _startX, y + _dlgY - _startY); - } + int posX = x + _dlgX - _startX, + posY = y + _dlgY - _startY; + setPosition(posX, posY); + + GUIInfo *info = (GUIInfo *)getUserData(); + if (info && info->node) { + info->node->setIntValue("x", posX); + info->node->setIntValue("y", posY); + } + } // re-positioning } else if (_dragging) { fgSetMouseCursor(_start_cursor); -- 2.39.5