@@ -387,6 +387,11 @@ def get_horizontalalignment(self):
387387 "Return the horizontal alignment as string"
388388 return self ._horizontalalignment
389389
390+
391+ def _get_xy_display (self ):
392+ 'get the (possibly unit converted) transformed x,y in display coords'
393+ return self .get_transform ().xy_tup ((self ._x , self ._y ))
394+
390395 def get_position (self ):
391396 "Return x, y as tuple"
392397 x = float (self .convert_xunits (self ._x ))
@@ -770,7 +775,26 @@ def __init__(self,
770775
771776 #self.set_bbox(dict(pad=0))
772777
778+ def get_position (self ):
779+ "Return x, y as tuple"
780+ x = float (self .convert_xunits (self ._dashx ))
781+ y = float (self .convert_yunits (self ._dashy ))
782+ return x , y
783+
784+ def get_prop_tup (self ):
785+ """
786+ Return a hashable tuple of properties
787+
788+ Not intended to be human readable, but useful for backends who
789+ want to cache derived information about text (eg layouts) and
790+ need to know if the text has changed
791+ """
792+ props = [p for p in Text .get_prop_tup (self )]
793+ props .extend ([self ._x , self ._y , self ._dashlength , self ._dashdirection , self ._dashrotation , self ._dashpad , self ._dashpush ])
794+ return tuple (props )
795+
773796 def draw (self , renderer ):
797+ self .cached = dict ()
774798 self .update_coords (renderer )
775799 Text .draw (self , renderer )
776800 if self .get_dashlength () > 0.0 :
@@ -846,7 +870,11 @@ def update_coords(self, renderer):
846870 cwd *= 1 + dashpad / npy .sqrt (npy .dot (cwd ,cwd ))
847871 cw = c2 + (dashdirection * 2 - 1 )* cwd
848872
849- self ._x , self ._y = transform .inverse_xy_tup (tuple (cw ))
873+
874+
875+ newx , newy = transform .inverse_xy_tup (tuple (cw ))
876+
877+ self ._x , self ._y = newx , newy
850878
851879 # Now set the window extent
852880 # I'm not at all sure this is the right way to do this.
@@ -930,9 +958,6 @@ def set_dashpush(self, dp):
930958 """
931959 self ._dashpush = dp
932960
933- def get_position (self ):
934- "Return x, y as tuple"
935- return self ._dashx , self ._dashy
936961
937962 def set_position (self , xy ):
938963 """
0 commit comments