Browse Source

correctly default aspect ratio

David Rose 22 years ago
parent
commit
644310d7d5
1 changed files with 2 additions and 16 deletions
  1. 2 16
      direct/src/showbase/ShowBase.py

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

@@ -647,26 +647,12 @@ class ShowBase(DirectObject.DirectObject):
         # window will be cleared, which is normally sufficient).
 
         if aspectRatio == None:
-            aspectRatio = self.aspectRatio
+            aspectRatio = self.getAspectRatio()
 
         # Now make a new Camera node.
         camNode = Camera('cam')
         lens = PerspectiveLens()
-
-        if aspectRatio:
-            lens.setAspectRatio(aspectRatio)
-
-        else:
-            # If the aspectRatio is 0 or None, set up the lens with a
-            # film size that matches the window size.  This sets up
-            # the correct aspect ratio automatically (assuming the
-            # pixels are square).
-            
-            props = win.getProperties()
-            if not props.hasSize():
-                props = win.getRequestedProperties()
-            if props.hasSize():
-                lens.setFilmSize(props.getXSize(), props.getYSize())
+        lens.setAspectRatio(aspectRatio)
             
         camNode.setLens(lens)
         camNode.setScene(scene)