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

This commit is contained in:
rdb 2018-01-05 19:49:02 +01:00
parent 36636aad81
commit bdb53b8cb5

View File

@ -2732,9 +2732,10 @@ class ShowBase(DirectObject.DirectObject):
# changed and update the camera lenses and aspect2d parameters
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.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:
xsize, ysize = self.getSize()
if xsize > 0 and ysize > 0: