@@ -2815,37 +2815,25 @@ class TransformedPatchPath(TransformedPath):
2815
2815
`~.patches.Patch`. This cached copy is automatically updated when the
2816
2816
non-affine part of the transform or the patch changes.
2817
2817
"""
2818
+
2818
2819
def __init__ (self , patch ):
2819
2820
"""
2820
2821
Parameters
2821
2822
----------
2822
2823
patch : `~.patches.Patch`
2823
2824
"""
2824
- TransformNode .__init__ (self )
2825
-
2826
- transform = patch .get_transform ()
2825
+ # Defer to TransformedPath.__init__.
2826
+ super ().__init__ (patch .get_path (), patch .get_transform ())
2827
2827
self ._patch = patch
2828
- self ._transform = transform
2829
- self .set_children (transform )
2830
- self ._path = patch .get_path ()
2831
- self ._transformed_path = None
2832
- self ._transformed_points = None
2833
2828
2834
2829
def _revalidate (self ):
2835
2830
patch_path = self ._patch .get_path ()
2836
- # Only recompute if the invalidation includes the non_affine part of
2837
- # the transform, or the Patch's Path has changed.
2838
- if (self ._transformed_path is None or self ._path != patch_path or
2839
- (self ._invalid & self .INVALID_NON_AFFINE ==
2840
- self .INVALID_NON_AFFINE )):
2831
+ # Force invalidation if the patch path changed; otherwise, let base
2832
+ # class check invalidation.
2833
+ if patch_path != self ._path :
2841
2834
self ._path = patch_path
2842
- self ._transformed_path = \
2843
- self ._transform .transform_path_non_affine (patch_path )
2844
- self ._transformed_points = \
2845
- Path ._fast_from_codes_and_verts (
2846
- self ._transform .transform_non_affine (patch_path .vertices ),
2847
- None , patch_path )
2848
- self ._invalid = 0
2835
+ self ._transformed_path = None
2836
+ super ()._revalidate ()
2849
2837
2850
2838
2851
2839
def nonsingular (vmin , vmax , expander = 0.001 , tiny = 1e-15 , increasing = True ):
0 commit comments