(self, width, height)
Resize the canvas and make appropriate changes to the scene.
Resize the canvas and make appropriate changes to the scene.
Resize the canvas and make appropriate changes to the scene .
def resize(self, width, height):
        """Resize the canvas and make appropriate changes to the scene."""
        # paint within the whole window
        gl.glViewport(0, 0, width, height)
        # compute the constrained viewport
        x = y = 1.0
        if self.get_renderer_option('constrain_ratio'):
            if height > 0:
                aw = float(width) / height
                ar = self.get_renderer_option('constrain_ratio')
                if ar is True:
                    ar = 1.
                if ar < aw:
                    x, y = aw / ar, 1.
                else:
                    x, y = 1., ar / aw
        self.viewport = x, y
        width = float(width)
        height = float(height)
        # update the viewport and window size for all visuals
        for visual in self.get_visuals():
            self.set_data(visual['name'],
                          viewport=self.viewport,
                          window_size=(width, height))
def resize ( self , width , height ) : # paint within the whole window gl . glViewport ( 0 , 0 , width , height ) # compute the constrained viewport x = y = 1.0 if self . get_renderer_option ( 'constrain_ratio' ) : if height > 0 : aw = float ( width ) / height ar = self . get_renderer_option ( 'constrain_ratio' ) if ar is True : ar = 1. if ar < aw : x , y = aw / ar , 1. else : x , y = 1. , ar / aw self . viewport = x , y width = float ( width ) height = float ( height ) # update the viewport and window size for all visuals for visual in self . get_visuals ( ) : self . set_data ( visual [ 'name' ] , viewport = self . viewport , window_size = ( width , height ) )