def METHOD_NAME(self, rectangle):
    if self.from_left:  horizontal = rectangle.x1
    else:               horizontal = rectangle.x2
    if isinstance(self.horizontal, float):
        distance = self.horizontal * rectangle.dx
    else:
        distance = self.horizontal
    horizontal += distance
    if self.from_top:   vertical = rectangle.y1
    else:               vertical = rectangle.y2
    if isinstance(self.vertical, float):
        distance = self.vertical * rectangle.dy
    else:
        distance = self.vertical
    vertical += distance
    self._move_mouse(horizontal, vertical)