code: def snapPointToCanvas(self, x, y):
          
          if x < 0 or x > self.pixmap.width() or y < 0 or y > self.pixmap.height():
              x = max(x, 0)
              y = max(y, 0)
              x = min(x, self.pixmap.width())
              y = min(y, self.pixmap.height())
              return x, y, True
  
          return x, y, False
docs: Moves a point x,y to within the boundaries of the canvas.
          :return: (x,y,snapped) where snapped is True if x or y were changed, False if not.