From 644310d7d5faa04721ed3132f8d8e2094daf242d Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 11 Feb 2004 22:22:19 +0000 Subject: [PATCH] correctly default aspect ratio --- direct/src/showbase/ShowBase.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index a0ea668cf2..c55ab98e99 100644 --- a/direct/src/showbase/ShowBase.py +++ b/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)