Browse Source

showbase: fixes for aspect-ratio adjustment of pixel2d(p)

rdb 8 years ago
parent
commit
bdb53b8cb5
1 changed files with 3 additions and 2 deletions
  1. 3 2
      direct/src/showbase/ShowBase.py

+ 3 - 2
direct/src/showbase/ShowBase.py

@@ -2732,9 +2732,10 @@ class ShowBase(DirectObject.DirectObject):
             # changed and update the camera lenses and aspect2d parameters
             # changed and update the camera lenses and aspect2d parameters
             self.adjustWindowAspectRatio(self.getAspectRatio())
             self.adjustWindowAspectRatio(self.getAspectRatio())
 
 
-            if win.getSideBySideStereo() and win.hasSize() and win.getSbsLeftYSize() != 0:
+            if win.hasSize() and win.getSbsLeftYSize() != 0:
                 self.pixel2d.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize())
                 self.pixel2d.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize())
-                self.pixel2dp.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize())
+                if self.wantRender2dp:
+                    self.pixel2dp.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize())
             else:
             else:
                 xsize, ysize = self.getSize()
                 xsize, ysize = self.getSize()
                 if xsize > 0 and ysize > 0:
                 if xsize > 0 and ysize > 0: