@@ -3810,12 +3810,8 @@ def __str__(self):
3810
3810
return s % (self ._x , self ._y , self ._width , self ._height )
3811
3811
3812
3812
@_docstring .dedent_interpd
3813
- @_api .make_keyword_only ("3.6" , name = "mutation_scale" )
3814
- @_api .delete_parameter ("3.4" , "bbox_transmuter" , alternative = "boxstyle" )
3815
- def __init__ (self , xy , width , height ,
3816
- boxstyle = "round" , bbox_transmuter = None ,
3817
- mutation_scale = 1 , mutation_aspect = 1 ,
3818
- ** kwargs ):
3813
+ def __init__ (self , xy , width , height , boxstyle = "round" , * ,
3814
+ mutation_scale = 1 , mutation_aspect = 1 , ** kwargs ):
3819
3815
"""
3820
3816
Parameters
3821
3817
----------
@@ -3857,27 +3853,12 @@ def __init__(self, xy, width, height,
3857
3853
"""
3858
3854
3859
3855
super ().__init__ (** kwargs )
3860
-
3861
- self ._x = xy [0 ]
3862
- self ._y = xy [1 ]
3856
+ self ._x , self ._y = xy
3863
3857
self ._width = width
3864
3858
self ._height = height
3865
-
3866
- if boxstyle == "custom" :
3867
- _api .warn_deprecated (
3868
- "3.4" , message = "Support for boxstyle='custom' is deprecated "
3869
- "since %(since)s and will be removed %(removal)s; directly "
3870
- "pass a boxstyle instance as the boxstyle parameter instead." )
3871
- if bbox_transmuter is None :
3872
- raise ValueError ("bbox_transmuter argument is needed with "
3873
- "custom boxstyle" )
3874
- self ._bbox_transmuter = bbox_transmuter
3875
- else :
3876
- self .set_boxstyle (boxstyle )
3877
-
3859
+ self .set_boxstyle (boxstyle )
3878
3860
self ._mutation_scale = mutation_scale
3879
3861
self ._mutation_aspect = mutation_aspect
3880
-
3881
3862
self .stale = True
3882
3863
3883
3864
@_docstring .dedent_interpd
@@ -3958,30 +3939,12 @@ def get_mutation_aspect(self):
3958
3939
def get_path (self ):
3959
3940
"""Return the mutated path of the rectangle."""
3960
3941
boxstyle = self .get_boxstyle ()
3961
- x = self ._x
3962
- y = self ._y
3963
- width = self ._width
3964
- height = self ._height
3965
- m_scale = self .get_mutation_scale ()
3966
3942
m_aspect = self .get_mutation_aspect ()
3967
- # Squeeze the given height by the aspect_ratio.
3968
- y , height = y / m_aspect , height / m_aspect
3969
- # Call boxstyle with squeezed height.
3970
- try :
3971
- inspect .signature (boxstyle ).bind (x , y , width , height , m_scale )
3972
- except TypeError :
3973
- # Don't apply aspect twice.
3974
- path = boxstyle (x , y , width , height , m_scale , 1 )
3975
- _api .warn_deprecated (
3976
- "3.4" , message = "boxstyles must be callable without the "
3977
- "'mutation_aspect' parameter since %(since)s; support for the "
3978
- "old call signature will be removed %(removal)s." )
3979
- else :
3980
- path = boxstyle (x , y , width , height , m_scale )
3981
- vertices , codes = path .vertices , path .codes
3982
- # Restore the height.
3983
- vertices [:, 1 ] = vertices [:, 1 ] * m_aspect
3984
- return Path (vertices , codes )
3943
+ # Call boxstyle with y, height squeezed by aspect_ratio.
3944
+ path = boxstyle (self ._x , self ._y / m_aspect ,
3945
+ self ._width , self ._height / m_aspect ,
3946
+ self .get_mutation_scale ())
3947
+ return Path (path .vertices * [1 , m_aspect ], path .codes ) # Unsqueeze y.
3985
3948
3986
3949
# Following methods are borrowed from the Rectangle class.
3987
3950
0 commit comments