]> git.mxchange.org Git - flightgear.git/commitdiff
Bugfix for #106: main view port aspect-ratio broken when 2D panels are moved
authorThorstenB <brehmt@gmail.com>
Sun, 22 May 2011 16:18:39 +0000 (18:18 +0200)
committerThorstenB <brehmt@gmail.com>
Sun, 22 May 2011 16:32:15 +0000 (18:32 +0200)
Seems the hack was necessary for the pre-OSG display only. Or the feature
is broken since OSG port altogether. But it caused issues for 3D and 2D
cockpits when /sim/virtual-cockpit wasn't enabled. => Removing for now.

src/Main/renderer.cxx

index 7b6c710c66d192a39fbd673372f96a27c16cd6a6..a6b216ead99f47ca9fa22583585785f356872aa6 100644 (file)
@@ -770,16 +770,16 @@ FGRenderer::update( bool refresh_camera_settings ) {
 // Handle new window size or exposure
 void
 FGRenderer::resize( int width, int height ) {
-    int view_h;
-
-    if ( (!_virtual_cockpit->getBoolValue())
-         && fgPanelVisible() && idle_state == 1000 ) {
-        view_h = (int)(height * (globals->get_current_panel()->getViewHeight() -
-                             globals->get_current_panel()->getYOffset()) / 768.0);
-    } else {
-        view_h = height;
-    }
-
+    int view_h = height;
+
+// the following breaks aspect-ratio of the main 3D scenery window when 2D panels are moved
+// in y direction - causing issues for aircraft with 2D panels (/sim/virtual_cockpit=false).
+// Disabling for now. Seems this useful for the pre-OSG time only.
+//    if ( (!_virtual_cockpit->getBoolValue())
+//         && fgPanelVisible() && idle_state == 1000 ) {
+//        view_h = (int)(height * (globals->get_current_panel()->getViewHeight() -
+//                             globals->get_current_panel()->getYOffset()) / 768.0);
+//    }
     static int lastwidth = 0;
     static int lastheight = 0;
     if (width != lastwidth)