def updatePosition(self):
# update text position to relative view location along line
self._endpoints = (None, None)
pt1, pt2 = self.getEndpoints()
if pt1 is None:
return
pt = pt2 * self.orthoPos + pt1 * (1-self.orthoPos)
self.setPos(pt)
#This flips the text label automatically to the left or right of the line when the
#line transverses the middle of the viewbox
# update anchor to keep text visible as it nears the view box edge
# vr = self.line.viewRect()
# if vr is not None:
# logger.debug(vr.center().y())
# self.setAnchor(self.anchors[0 if vr.center().y() < 0 else 1])