File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,27 @@ def test_rotate_rect():
76
76
assert_almost_equal (rect1 .get_verts (), new_verts )
77
77
78
78
79
+ @check_figures_equal (extensions = ['png' ])
80
+ def test_rotate_rect_draw (fig_test , fig_ref ):
81
+ ax_test = fig_test .add_subplot ()
82
+ ax_ref = fig_ref .add_subplot ()
83
+
84
+ loc = (0 , 0 )
85
+ width , height = (1 , 1 )
86
+ angle = 30
87
+ rect_ref = Rectangle (loc , width , height , angle = angle )
88
+ ax_ref .add_patch (rect_ref )
89
+ assert rect_ref .get_angle () == angle
90
+
91
+ # Check that when the angle is updated after adding to an axes, that the
92
+ # patch is marked stale and redrawn in the correct location
93
+ rect_test = Rectangle (loc , width , height )
94
+ assert rect_test .get_angle () == 0
95
+ ax_test .add_patch (rect_test )
96
+ rect_test .set_angle (angle )
97
+ assert rect_test .get_angle () == angle
98
+
99
+
79
100
def test_negative_rect ():
80
101
# These two rectangles have the same vertices, but starting from a
81
102
# different point. (We also drop the last vertex, which is a duplicate.)
You can’t perform that action at this time.
0 commit comments