@@ -723,6 +723,12 @@ def _update_patch_transform(self):
723
723
self ._rect_transform = transforms .BboxTransformTo (bbox )
724
724
self ._rect_transform += rot_trans
725
725
726
+ def _update_x1 (self ):
727
+ self ._x1 = self ._x0 + self ._width
728
+
729
+ def _update_y1 (self ):
730
+ self ._y1 = self ._y0 + self ._height
731
+
726
732
def get_patch_transform (self ):
727
733
self ._update_patch_transform ()
728
734
return self ._rect_transform
@@ -754,7 +760,7 @@ def set_x(self, x):
754
760
ACCEPTS: float
755
761
"""
756
762
self ._x0 = x
757
- self ._x1 = x + self . _width
763
+ self ._update_x1 ()
758
764
self .stale = True
759
765
760
766
def set_y (self , y ):
@@ -764,7 +770,7 @@ def set_y(self, y):
764
770
ACCEPTS: float
765
771
"""
766
772
self ._y0 = y
767
- self ._y1 = y + self . _height
773
+ self ._update_y1 ()
768
774
self .stale = True
769
775
770
776
def set_xy (self , xy ):
@@ -774,6 +780,8 @@ def set_xy(self, xy):
774
780
ACCEPTS: 2-item sequence
775
781
"""
776
782
self ._x0 , self ._y0 = xy
783
+ self ._update_x1 ()
784
+ self ._update_y1 ()
777
785
self .stale = True
778
786
779
787
def set_width (self , w ):
@@ -783,7 +791,7 @@ def set_width(self, w):
783
791
ACCEPTS: float
784
792
"""
785
793
self ._width = w
786
- self ._x1 = self . _x0 + w
794
+ self ._update_x1 ()
787
795
self .stale = True
788
796
789
797
def set_height (self , h ):
@@ -793,7 +801,7 @@ def set_height(self, h):
793
801
ACCEPTS: float
794
802
"""
795
803
self ._height = h
796
- self ._y1 = self . _y0 + h
804
+ self ._update_y1 ()
797
805
self .stale = True
798
806
799
807
def set_bounds (self , * args ):
@@ -810,8 +818,8 @@ def set_bounds(self, *args):
810
818
self ._y0 = b
811
819
self ._width = w
812
820
self ._height = h
813
- self ._x0 = l + w
814
- self ._y0 = b + h
821
+ self ._update_x1 ()
822
+ self ._update_y1 ()
815
823
self .stale = True
816
824
817
825
def get_bbox (self ):
0 commit comments