(self, x, y)
return abs_x + offs_x, abs_y + offs_y
Ensure coordinates are within screen + 1 pixel.
Ensure coordinates are within screen + 1 pixel.
Ensure coordinates are within screen + 1 pixel .
def cutoff_coord(self, x, y):
        """Ensure coordinates are within screen + 1 pixel."""
        abs_x, abs_y = self._convert_coords(x, y)
        offs_x, offs_y = x - abs_x, y - abs_y
        # clip absolute coornates to physical screen bounds plus one pixel
        abs_x = min(self._max_width, max(-1, abs_x))
        abs_y = min(self._max_height, max(-1, abs_y))
        # return viewpoint coordinates
        return abs_x + offs_x, abs_y + offs_y
def cutoff_coord ( self , x , y ) : abs_x , abs_y = self . _convert_coords ( x , y ) offs_x , offs_y = x - abs_x , y - abs_y # clip absolute coornates to physical screen bounds plus one pixel abs_x = min ( self . _max_width , max ( - 1 , abs_x ) ) abs_y = min ( self . _max_height , max ( - 1 , abs_y ) ) # return viewpoint coordinates return abs_x + offs_x , abs_y + offs_y