code: def left_motion(self, event):
          
          self.set_current()
          results = self.canvas.find_withtag(tk.CURRENT)
          if len(results) is 0:
              return
          item = results[0]
          rectangle = self.items[item]
          self.config(cursor="exchange")
          self.canvas.itemconfigure(item, fill="blue")
          xc, yc = self.canvas.canvasx(event.x), self.canvas.canvasy(event.y)
          dx, dy = xc - self.current_coords[0], yc - self.current_coords[1]
          self.current_coords = xc, yc
          self.canvas.move(item, dx, dy)
          # check whether the new position of the item respects the boundaries
          x, y = self.canvas.coords(item)
          x, y = max(min(x, self._max_x), 0), max(min(y, self._max_y), 0)
          self.canvas.coords(item, x, y)
          self.canvas.coords(rectangle, self.canvas.bbox(item))
docs: Callback for the B1-Motion event, or the dragging of an item.
  
          Moves the item to the desired location, but limits its movement to a
          place on the actual Canvas. The item cannot be moved outside of the Canvas.
  
          :param event: Tkinter event