@@ -2466,7 +2466,7 @@ def _invalidate_internal(self, level, invalidating_node):
2466
2466
super ()._invalidate_internal (level , invalidating_node )
2467
2467
2468
2468
def __eq__ (self , other ):
2469
- if isinstance (other , (CompositeGenericTransform , CompositeAffine2D )):
2469
+ if isinstance (other , (CompositeGenericTransform , CompositeAffine )):
2470
2470
return self is other or (self ._a == other ._a
2471
2471
and self ._b == other ._b )
2472
2472
else :
@@ -2526,7 +2526,7 @@ def inverted(self):
2526
2526
self ._b .inverted (), self ._a .inverted ())
2527
2527
2528
2528
2529
- class CompositeAffine2D ( Affine2DBase ):
2529
+ class CompositeAffine ( AffineImmutable ):
2530
2530
"""
2531
2531
A composite transform formed by applying transform *a* then transform *b*.
2532
2532
@@ -2536,7 +2536,7 @@ class CompositeAffine2D(Affine2DBase):
2536
2536
def __init__ (self , a , b , ** kwargs ):
2537
2537
"""
2538
2538
Create a new composite transform that is the result of
2539
- applying `Affine2DBase ` *a* then `Affine2DBase ` *b*.
2539
+ applying `AffineImmutable ` *a* then `AffineImmutable ` *b*.
2540
2540
2541
2541
You will generally not call this constructor directly but write ``a +
2542
2542
b`` instead, which will automatically choose the best kind of composite
@@ -2547,10 +2547,8 @@ def __init__(self, a, b, **kwargs):
2547
2547
if a .output_dims != b .input_dims :
2548
2548
raise ValueError ("The output dimension of 'a' must be equal to "
2549
2549
"the input dimensions of 'b'" )
2550
- self .input_dims = a .input_dims
2551
- self .output_dims = b .output_dims
2550
+ super ().__init__ (dims = a .output_dims , ** kwargs )
2552
2551
2553
- super ().__init__ (** kwargs )
2554
2552
self ._a = a
2555
2553
self ._b = b
2556
2554
self .set_children (a , b )
@@ -2579,6 +2577,11 @@ def get_matrix(self):
2579
2577
return self ._mtx
2580
2578
2581
2579
2580
+ @_api .deprecated ("3.9" , alternative = "CompositeAffine" )
2581
+ class CompositeAffine2D (CompositeAffine ):
2582
+ pass
2583
+
2584
+
2582
2585
def composite_transform_factory (a , b ):
2583
2586
"""
2584
2587
Create a new composite transform that is the result of applying
@@ -2602,7 +2605,7 @@ def composite_transform_factory(a, b):
2602
2605
elif isinstance (b , IdentityTransform ):
2603
2606
return a
2604
2607
elif isinstance (a , Affine2D ) and isinstance (b , Affine2D ):
2605
- return CompositeAffine2D (a , b )
2608
+ return CompositeAffine (a , b )
2606
2609
return CompositeGenericTransform (a , b )
2607
2610
2608
2611
0 commit comments