(
            self, canvas_x=None, canvas_y=None,
            resize_window=True, fullscreen=False
        )
return self._display_size != old_display_size or self._window_size != old_window_size
Change the logical canvas size and determine window/display sizes.
Change the logical canvas size and determine window/display sizes.
Change the logical canvas size and determine window / display sizes .
def set_canvas_size(
            self, canvas_x=None, canvas_y=None,
            resize_window=True, fullscreen=False
        ):
        """Change the logical canvas size and determine window/display sizes."""
        if canvas_x is not None and canvas_y is not None:
            self._canvas_logical = canvas_x, canvas_y
        self._calculate_border_shift()
        old_display_size = self._display_size
        old_window_size = self._window_size
        if resize_window or self._force_native_pixel:
            # comply with requested size
            if self._force_window_size:
                self._window_size = self._force_window_size
            else:
                slack_ratio = _SLACK_RATIO if not fullscreen else 1.
                if not self._force_native_pixel:
                    self._window_size = self._find_nonnative_window_size(slack_ratio)
                else:
                    self._window_size = self._find_native_window_size(slack_ratio)
            if fullscreen:
                self._display_size = self._screen_size
            else:
                self._display_size = self._window_size
        self._calculate_scale()
        self._calculate_letterbox_shift()
        return self._display_size != old_display_size or self._window_size != old_window_size
def set_canvas_size ( self , canvas_x = None , canvas_y = None , resize_window = True , fullscreen = False ) : if canvas_x is not None and canvas_y is not None : self . _canvas_logical = canvas_x , canvas_y self . _calculate_border_shift ( ) old_display_size = self . _display_size old_window_size = self . _window_size if resize_window or self . _force_native_pixel : # comply with requested size if self . _force_window_size : self . _window_size = self . _force_window_size else : slack_ratio = _SLACK_RATIO if not fullscreen else 1. if not self . _force_native_pixel : self . _window_size = self . _find_nonnative_window_size ( slack_ratio ) else : self . _window_size = self . _find_native_window_size ( slack_ratio ) if fullscreen : self . _display_size = self . _screen_size else : self . _display_size = self . _window_size self . _calculate_scale ( ) self . _calculate_letterbox_shift ( ) return self . _display_size != old_display_size or self . _window_size != old_window_size