'on motion notify event if box/line is wanted'

def _onmove(self, event):

    if (self.active_handle and (not (self.active_handle == u'C'))):
        (x1, x2, y1, y2) = self._extents_on_press
        if (self.active_handle in ([u'E', u'W'] + self._corner_order)):
            x2 = event.xdata
        if (self.active_handle in ([u'N', u'S'] + self._corner_order)):
            y2 = event.ydata
    elif (((u'move' in self.state) or (self.active_handle == u'C')) and (self._extents_on_press is not None)):
        (x1, x2, y1, y2) = self._extents_on_press
        dx = (event.xdata - self.eventpress.xdata)
        dy = (event.ydata - self.eventpress.ydata)
        x1 += dx
        x2 += dx
        y1 += dy
        y2 += dy
    else:
        center = [self.eventpress.xdata, self.eventpress.ydata]
        center_pix = [self.eventpress.x, self.eventpress.y]
        dx = ((event.xdata - center[0]) / 2.0)
        dy = ((event.ydata - center[1]) / 2.0)
        if (u'square' in self.state):
            dx_pix = abs((event.x - center_pix[0]))
            dy_pix = abs((event.y - center_pix[1]))
            if (not dx_pix):
                return
            maxd = max(abs(dx_pix), abs(dy_pix))
            if (abs(dx_pix) < maxd):
                dx *= (maxd / (abs(dx_pix) + 1e-06))
            if (abs(dy_pix) < maxd):
                dy *= (maxd / (abs(dy_pix) + 1e-06))
        if (u'center' in self.state):
            dx *= 2
            dy *= 2
        else:
            center[0] += dx
            center[1] += dy
        (x1, x2, y1, y2) = ((center[0] - dx), (center[0] + dx), (center[1] - dy), (center[1] + dy))
    self.extents = (x1, x2, y1, y2)
