'Computes the actual *x*, *y* coordinates for text based on the
input *x*, *y* and the *dashlength*. Since the rotation is
with respect to the actual canvas\'s coordinates we need to map
back and forth.'

def update_coords(self, renderer):

    (dashx, dashy) = self.get_unitless_position()
    dashlength = self.get_dashlength()
    if (dashlength == 0.0):
        (self._x, self._y) = (dashx, dashy)
        return
    dashrotation = self.get_dashrotation()
    dashdirection = self.get_dashdirection()
    dashpad = self.get_dashpad()
    dashpush = self.get_dashpush()
    angle = get_rotation(dashrotation)
    theta = (np.pi * (((angle / 180.0) + dashdirection) - 1))
    (cos_theta, sin_theta) = (np.cos(theta), np.sin(theta))
    transform = self.get_transform()
    cxy = transform.transform_point((dashx, dashy))
    cd = np.array([cos_theta, sin_theta])
    c1 = (cxy + (dashpush * cd))
    c2 = (cxy + ((dashpush + dashlength) * cd))
    inverse = transform.inverted()
    (x1, y1) = inverse.transform_point(tuple(c1))
    (x2, y2) = inverse.transform_point(tuple(c2))
    self.dashline.set_data((x1, x2), (y1, y2))
    we = Text.get_window_extent(self, renderer=renderer)
    (w, h) = (we.width, we.height)
    if (sin_theta == 0.0):
        dx = w
        dy = 0.0
    elif (cos_theta == 0.0):
        dx = 0.0
        dy = h
    else:
        tan_theta = (sin_theta / cos_theta)
        dx = w
        dy = (w * tan_theta)
        if ((dy > h) or (dy < (- h))):
            dy = h
            dx = (h / tan_theta)
    cwd = (np.array([dx, dy]) / 2)
    cwd *= (1 + (dashpad / np.sqrt(np.dot(cwd, cwd))))
    cw = (c2 + (((dashdirection * 2) - 1) * cwd))
    (newx, newy) = inverse.transform_point(tuple(cw))
    (self._x, self._y) = (newx, newy)
    we = Text.get_window_extent(self, renderer=renderer)
    self._twd_window_extent = we.frozen()
    self._twd_window_extent.update_from_data_xy(np.array([c1]), False)
    Text.set_horizontalalignment(self, u'center')
    Text.set_verticalalignment(self, u'center')
