From: jmt Date: Mon, 15 Feb 2010 23:34:53 +0000 (+0000) Subject: Bugfix: stop dialogs jumping around when re-layout occurs - make positions persistent. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=26361f2f5aea7d6e7c621235bdbf71e76c87997a;p=flightgear.git Bugfix: stop dialogs jumping around when re-layout occurs - make positions persistent. --- 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);