]> git.mxchange.org Git - flightgear.git/commitdiff
Bugfix: stop dialogs jumping around when re-layout occurs - make positions persistent.
authorjmt <jmt>
Mon, 15 Feb 2010 23:34:53 +0000 (23:34 +0000)
committerTim Moore <timoore33@gmail.com>
Wed, 17 Feb 2010 06:31:05 +0000 (07:31 +0100)
src/GUI/dialog.cxx

index 95fe5f04c1fad5f40f56783fb492facf157f66b0..e20a62b930015edc48be097d61e62b1215a7e781 100644 (file)
@@ -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);