parameters: (self, aspectRatio)
docstring: This function is normally called internally by
          `windowEvent()`, but it may also be called to explicitly adjust
          the aspect ratio of the render/render2d DisplayRegion, by a
          class that has redefined these.
docstring_summary: This function is normally called internally by
          `windowEvent()`, but it may also be called to explicitly adjust
          the aspect ratio of the render/render2d DisplayRegion, by a
          class that has redefined these.
docstring_tokens: This function is normally called internally by windowEvent () but it may also be called to explicitly adjust the aspect ratio of the render / render2d DisplayRegion by a class that has redefined these .
function: def adjustWindowAspectRatio(self, aspectRatio):
          """ This function is normally called internally by
          `windowEvent()`, but it may also be called to explicitly adjust
          the aspect ratio of the render/render2d DisplayRegion, by a
          class that has redefined these. """
  
          if self.__configAspectRatio:
              aspectRatio = self.__configAspectRatio
  
          if aspectRatio != self.__oldAspectRatio:
              self.__oldAspectRatio = aspectRatio
              # Fix up some anything that depends on the aspectRatio
              if self.camLens:
                  self.camLens.setAspectRatio(aspectRatio)
              if aspectRatio < 1:
                  # If the window is TALL, lets expand the top and bottom
                  self.aspect2d.setScale(1.0, aspectRatio, aspectRatio)
                  self.a2dTop = 1.0 / aspectRatio
                  self.a2dBottom = - 1.0 / aspectRatio
                  self.a2dLeft = -1
                  self.a2dRight = 1.0
                  # Don't forget 2dp
                  if self.wantRender2dp:
                      self.aspect2dp.setScale(1.0, aspectRatio, aspectRatio)
                      self.a2dpTop = 1.0 / aspectRatio
                      self.a2dpBottom = - 1.0 / aspectRatio
                      self.a2dpLeft = -1
                      self.a2dpRight = 1.0
  
              else:
                  # If the window is WIDE, lets expand the left and right
                  self.aspect2d.setScale(1.0 / aspectRatio, 1.0, 1.0)
                  self.a2dTop = 1.0
                  self.a2dBottom = -1.0
                  self.a2dLeft = -aspectRatio
                  self.a2dRight = aspectRatio
                  # Don't forget 2dp
                  if self.wantRender2dp:
                      self.aspect2dp.setScale(1.0 / aspectRatio, 1.0, 1.0)
                      self.a2dpTop = 1.0
                      self.a2dpBottom = -1.0
                      self.a2dpLeft = -aspectRatio
                      self.a2dpRight = aspectRatio
  
              # Reposition the aspect2d marker nodes
              self.a2dTopCenter.setPos(0, 0, self.a2dTop)
              self.a2dTopCenterNs.setPos(0, 0, self.a2dTop)
              self.a2dBottomCenter.setPos(0, 0, self.a2dBottom)
              self.a2dBottomCenterNs.setPos(0, 0, self.a2dBottom)
              self.a2dLeftCenter.setPos(self.a2dLeft, 0, 0)
              self.a2dLeftCenterNs.setPos(self.a2dLeft, 0, 0)
              self.a2dRightCenter.setPos(self.a2dRight, 0, 0)
              self.a2dRightCenterNs.setPos(self.a2dRight, 0, 0)
  
              self.a2dTopLeft.setPos(self.a2dLeft, 0, self.a2dTop)
              self.a2dTopLeftNs.setPos(self.a2dLeft, 0, self.a2dTop)
              self.a2dTopRight.setPos(self.a2dRight, 0, self.a2dTop)
              self.a2dTopRightNs.setPos(self.a2dRight, 0, self.a2dTop)
              self.a2dBottomLeft.setPos(self.a2dLeft, 0, self.a2dBottom)
              self.a2dBottomLeftNs.setPos(self.a2dLeft, 0, self.a2dBottom)
              self.a2dBottomRight.setPos(self.a2dRight, 0, self.a2dBottom)
              self.a2dBottomRightNs.setPos(self.a2dRight, 0, self.a2dBottom)
  
              # Reposition the aspect2dp marker nodes
              if self.wantRender2dp:
                  self.a2dpTopCenter.setPos(0, 0, self.a2dpTop)
                  self.a2dpBottomCenter.setPos(0, 0, self.a2dpBottom)
                  self.a2dpLeftCenter.setPos(self.a2dpLeft, 0, 0)
                  self.a2dpRightCenter.setPos(self.a2dpRight, 0, 0)
  
                  self.a2dpTopLeft.setPos(self.a2dpLeft, 0, self.a2dpTop)
                  self.a2dpTopRight.setPos(self.a2dpRight, 0, self.a2dpTop)
                  self.a2dpBottomLeft.setPos(self.a2dpLeft, 0, self.a2dpBottom)
                  self.a2dpBottomRight.setPos(self.a2dpRight, 0, self.a2dpBottom)
  
              # If anybody needs to update their GUI, put a callback on this event
              messenger.send("aspectRatioChanged")
function_tokens: def adjustWindowAspectRatio ( self , aspectRatio ) : if self . __configAspectRatio : aspectRatio = self . __configAspectRatio if aspectRatio != self . __oldAspectRatio : self . __oldAspectRatio = aspectRatio # Fix up some anything that depends on the aspectRatio if self . camLens : self . camLens . setAspectRatio ( aspectRatio ) if aspectRatio < 1 : # If the window is TALL, lets expand the top and bottom self . aspect2d . setScale ( 1.0 , aspectRatio , aspectRatio ) self . a2dTop = 1.0 / aspectRatio self . a2dBottom = - 1.0 / aspectRatio self . a2dLeft = - 1 self . a2dRight = 1.0 # Don't forget 2dp if self . wantRender2dp : self . aspect2dp . setScale ( 1.0 , aspectRatio , aspectRatio ) self . a2dpTop = 1.0 / aspectRatio self . a2dpBottom = - 1.0 / aspectRatio self . a2dpLeft = - 1 self . a2dpRight = 1.0 else : # If the window is WIDE, lets expand the left and right self . aspect2d . setScale ( 1.0 / aspectRatio , 1.0 , 1.0 ) self . a2dTop = 1.0 self . a2dBottom = - 1.0 self . a2dLeft = - aspectRatio self . a2dRight = aspectRatio # Don't forget 2dp if self . wantRender2dp : self . aspect2dp . setScale ( 1.0 / aspectRatio , 1.0 , 1.0 ) self . a2dpTop = 1.0 self . a2dpBottom = - 1.0 self . a2dpLeft = - aspectRatio self . a2dpRight = aspectRatio # Reposition the aspect2d marker nodes self . a2dTopCenter . setPos ( 0 , 0 , self . a2dTop ) self . a2dTopCenterNs . setPos ( 0 , 0 , self . a2dTop ) self . a2dBottomCenter . setPos ( 0 , 0 , self . a2dBottom ) self . a2dBottomCenterNs . setPos ( 0 , 0 , self . a2dBottom ) self . a2dLeftCenter . setPos ( self . a2dLeft , 0 , 0 ) self . a2dLeftCenterNs . setPos ( self . a2dLeft , 0 , 0 ) self . a2dRightCenter . setPos ( self . a2dRight , 0 , 0 ) self . a2dRightCenterNs . setPos ( self . a2dRight , 0 , 0 ) self . a2dTopLeft . setPos ( self . a2dLeft , 0 , self . a2dTop ) self . a2dTopLeftNs . setPos ( self . a2dLeft , 0 , self . a2dTop ) self . a2dTopRight . setPos ( self . a2dRight , 0 , self . a2dTop ) self . a2dTopRightNs . setPos ( self . a2dRight , 0 , self . a2dTop ) self . a2dBottomLeft . setPos ( self . a2dLeft , 0 , self . a2dBottom ) self . a2dBottomLeftNs . setPos ( self . a2dLeft , 0 , self . a2dBottom ) self . a2dBottomRight . setPos ( self . a2dRight , 0 , self . a2dBottom ) self . a2dBottomRightNs . setPos ( self . a2dRight , 0 , self . a2dBottom ) # Reposition the aspect2dp marker nodes if self . wantRender2dp : self . a2dpTopCenter . setPos ( 0 , 0 , self . a2dpTop ) self . a2dpBottomCenter . setPos ( 0 , 0 , self . a2dpBottom ) self . a2dpLeftCenter . setPos ( self . a2dpLeft , 0 , 0 ) self . a2dpRightCenter . setPos ( self . a2dpRight , 0 , 0 ) self . a2dpTopLeft . setPos ( self . a2dpLeft , 0 , self . a2dpTop ) self . a2dpTopRight . setPos ( self . a2dpRight , 0 , self . a2dpTop ) self . a2dpBottomLeft . setPos ( self . a2dpLeft , 0 , self . a2dpBottom ) self . a2dpBottomRight . setPos ( self . a2dpRight , 0 , self . a2dpBottom ) # If anybody needs to update their GUI, put a callback on this event messenger . send ( "aspectRatioChanged" )