'Update line with last point and current coordinates.'

def mouseMoveEvent(self, ev):

    pos = self.transformPos(ev.pos())
    self.restoreCursor()
    if self.drawing():
        self.overrideCursor(CURSOR_DRAW)
        if self.current:
            color = self.lineColor
            if self.outOfPixmap(pos):
                pos = self.intersectionPoint(self.current[(-1)], pos)
            elif ((len(self.current) > 1) and self.closeEnough(pos, self.current[0])):
                pos = self.current[0]
                color = self.current.line_color
                self.overrideCursor(CURSOR_POINT)
                self.current.highlightVertex(0, Shape.NEAR_VERTEX)
            self.line[1] = pos
            self.line.line_color = color
            self.repaint()
            self.current.highlightClear()
        return
    if (Qt.RightButton & ev.buttons()):
        if (self.selectedShapeCopy and self.prevPoint):
            self.overrideCursor(CURSOR_MOVE)
            self.boundedMoveShape(self.selectedShapeCopy, pos)
            self.repaint()
        elif self.selectedShape:
            self.selectedShapeCopy = self.selectedShape.copy()
            self.repaint()
        return
    if (Qt.LeftButton & ev.buttons()):
        if self.selectedVertex():
            self.boundedMoveVertex(pos)
            self.shapeMoved.emit()
            self.repaint()
        elif (self.selectedShape and self.prevPoint):
            self.overrideCursor(CURSOR_MOVE)
            self.boundedMoveShape(self.selectedShape, pos)
            self.shapeMoved.emit()
            self.repaint()
        return
    self.setToolTip('Image')
    for shape in reversed([s for s in self.shapes if self.isVisible(s)]):
        index = shape.nearestVertex(pos, self.epsilon)
        if (index is not None):
            if self.selectedVertex():
                self.hShape.highlightClear()
            (self.hVertex, self.hShape) = (index, shape)
            shape.highlightVertex(index, shape.MOVE_VERTEX)
            self.overrideCursor(CURSOR_POINT)
            self.setToolTip('Click    &    drag    to    move    point')
            self.setStatusTip(self.toolTip())
            self.update()
            break
        elif shape.containsPoint(pos):
            if self.selectedVertex():
                self.hShape.highlightClear()
            (self.hVertex, self.hShape) = (None, shape)
            self.setToolTip(("Click    &    drag    to    move    shape    '%s'" % shape.label))
            self.setStatusTip(self.toolTip())
            self.overrideCursor(CURSOR_GRAB)
            self.update()
            break
    else:
        if self.hShape:
            self.hShape.highlightClear()
            self.update()
        (self.hVertex, self.hShape) = (None, None)
