]> git.mxchange.org Git - flightgear.git/commitdiff
Fix yet another subtle resize problem I introduced, which upset PUI. This code is...
authorJames Turner <zakalawe@mac.com>
Sat, 28 May 2011 20:20:06 +0000 (21:20 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 28 May 2011 20:20:06 +0000 (21:20 +0100)
src/Main/renderer.cxx

index 4edaf240607690b0c1fccd96355a3a51d1aa447b..4902abea0611441c85d60533f3fc633930999e38 100644 (file)
@@ -784,9 +784,14 @@ FGRenderer::resize( int width, int height ) {
 
     int curWidth = _xsize->getIntValue(),
         curHeight = _ysize->getIntValue();
-
-    _xsize->setIntValue(width);
-    _ysize->setIntValue(height);
+    if ((curHeight != height) || (curWidth != width)) {
+    // must guard setting these, or PLIB-PUI fails with too many live interfaces
+        _xsize->setIntValue(width);
+        _ysize->setIntValue(height);
+    }
+    
+    // must set view aspect ratio each frame, or initial values are wrong.
+    // should probably be fixed 'smarter' during view setup.
     double aspect = height / (double) width;
 
     // for all views