@@ -93,13 +93,15 @@ def invalidate(self):
9393 """
9494 # If we are an affine transform being changed, we can set the
9595 # flag to INVALID_AFFINE_ONLY
96- value = ((self .is_affine or self .is_bbox )
97- and self .INVALID_AFFINE
98- or self .INVALID )
96+ value = (self .is_affine ) and self .INVALID_AFFINE or self .INVALID
9997
10098 # Shortcut: If self is already invalid, that means its parents
10199 # are as well, so we don't need to do anything.
102- if self ._invalid == value or not len (self ._parents ):
100+ if self ._invalid == value :
101+ return
102+
103+ if not len (self ._parents ):
104+ self ._invalid = value
103105 return
104106
105107 # Invalidate all ancestors of self using pseudo-recursion.
@@ -108,7 +110,7 @@ def invalidate(self):
108110 while len (stack ):
109111 root = stack .pop ()
110112 # Stop at subtrees that have already been invalidated
111- if root ._invalid == 0 or root .pass_through :
113+ if root ._invalid != value or root .pass_through :
112114 root ._invalid = value
113115 stack .extend (root ._parents .keys ())
114116
@@ -198,6 +200,7 @@ class BboxBase(TransformNode):
198200 read-only access to its data.
199201 """
200202 is_bbox = True
203+ is_affine = True
201204
202205 #* Redundant: Removed for performance
203206 #
@@ -208,6 +211,7 @@ class BboxBase(TransformNode):
208211 def _check (points ):
209212 if ma .isMaskedArray (points ):
210213 warnings .warn ("Bbox bounds are a masked array." )
214+ points = npy .asarray (points )
211215 if (points [1 ,0 ] - points [0 ,0 ] == 0 or
212216 points [1 ,1 ] - points [0 ,1 ] == 0 ):
213217 warnings .warn ("Singular Bbox." )
@@ -1011,6 +1015,8 @@ class TransformWrapper(Transform):
10111015 transform may only be replaced with another child transform of the
10121016 same dimensions.
10131017 """
1018+ pass_through = True
1019+
10141020 def __init__ (self , child ):
10151021 """
10161022 child: A Transform instance. This child may later be replaced
@@ -1546,7 +1552,6 @@ class BlendedAffine2D(Affine2DBase):
15461552 This version is an optimization for the case where both child
15471553 transforms are of type Affine2DBase.
15481554 """
1549-
15501555 is_separable = True
15511556
15521557 def __init__ (self , x_transform , y_transform ):
@@ -1917,8 +1922,8 @@ def get_transformed_path_and_affine(self):
19171922 the transform already applied, along with the affine part of
19181923 the path necessary to complete the transformation.
19191924 """
1920- if (self ._invalid & self .INVALID_NON_AFFINE or
1921- self ._transformed_path is None ):
1925+ if (( self ._invalid & self .INVALID_NON_AFFINE == self . INVALID_NON_AFFINE )
1926+ or self ._transformed_path is None ):
19221927 self ._transformed_path = \
19231928 self ._transform .transform_path_non_affine (self ._path )
19241929 self ._invalid = 0
@@ -1928,7 +1933,7 @@ def get_fully_transformed_path(self):
19281933 """
19291934 Return a fully-transformed copy of the child path.
19301935 """
1931- if (self ._invalid & self .INVALID_NON_AFFINE
1936+ if (( self ._invalid & self .INVALID_NON_AFFINE == self . INVALID_NON_AFFINE )
19321937 or self ._transformed_path is None ):
19331938 self ._transformed_path = \
19341939 self ._transform .transform_path_non_affine (self ._path )
0 commit comments