@@ -876,7 +876,8 @@ def _test_proj_make_M():
876
876
R = np .array ([100 , 100 , 100 ])
877
877
V = np .array ([0 , 0 , 1 ])
878
878
roll = 0
879
- viewM = proj3d .view_transformation (E , R , V , roll )
879
+ u , v , n = proj3d .view_axes (E , R , V , roll )
880
+ viewM = proj3d .view_transformation (u , v , n , E )
880
881
perspM = proj3d .persp_transformation (100 , - 100 , 1 )
881
882
M = np .dot (perspM , viewM )
882
883
return M
@@ -942,7 +943,8 @@ def test_proj_axes_cube_ortho():
942
943
R = np .array ([0 , 0 , 0 ])
943
944
V = np .array ([0 , 0 , 1 ])
944
945
roll = 0
945
- viewM = proj3d .view_transformation (E , R , V , roll )
946
+ u , v , n = proj3d .view_axes (E , R , V , roll )
947
+ viewM = proj3d .view_transformation (u , v , n , E )
946
948
orthoM = proj3d .ortho_transformation (- 1 , 1 )
947
949
M = np .dot (orthoM , viewM )
948
950
@@ -1533,16 +1535,16 @@ def convert_lim(dmin, dmax):
1533
1535
1534
1536
@pytest .mark .parametrize ("tool,button,expected" ,
1535
1537
[("zoom" , MouseButton .LEFT , # zoom in
1536
- ((- 0.02 , 0.06 ), (0 , 0.06 ), (- 0.01 , 0.06 ))),
1538
+ ((0.03 , 0.61 ), (0.27 , 0.71 ), (0.32 , 0.89 ))),
1537
1539
("zoom" , MouseButton .RIGHT , # zoom out
1538
- ((- 0.13 , 0.06 ), (- 0.18 , 0.06 ), (- 0.17 , 0.06 ))),
1540
+ ((0.29 , 0.35 ), (0.44 , 0.53 ), (0.57 , 0.64 ))),
1539
1541
("pan" , MouseButton .LEFT ,
1540
- ((- 0.46 , - 0.34 ), (- 0.66 , - 0.54 ), (- 0.62 , - 0.5 )))])
1542
+ ((- 0.70 , - 0.58 ), (- 1.03 , - 0.91 ), (- 1.27 , - 1.15 )))])
1541
1543
def test_toolbar_zoom_pan (tool , button , expected ):
1542
- # NOTE: The expected values are rough ballparks of moving in the view
1544
+ # NOTE: The expected zoom values are rough ballparks of moving in the view
1543
1545
# to make sure we are getting the right direction of motion.
1544
- # The specific values can and should change if the zoom/pan
1545
- # movement scaling factors get updated.
1546
+ # The specific values can and should change if the zoom movement
1547
+ # scaling factor gets updated.
1546
1548
fig = plt .figure ()
1547
1549
ax = fig .add_subplot (projection = '3d' )
1548
1550
ax .scatter (0 , 0 , 0 )
@@ -1577,9 +1579,9 @@ def test_toolbar_zoom_pan(tool, button, expected):
1577
1579
1578
1580
# Should be close, but won't be exact due to screen integer resolution
1579
1581
xlim , ylim , zlim = expected
1580
- assert ( ax .get_xlim3d () ) == pytest .approx (xlim , abs = 0.01 )
1581
- assert ( ax .get_ylim3d () ) == pytest .approx (ylim , abs = 0.01 )
1582
- assert ( ax .get_zlim3d () ) == pytest .approx (zlim , abs = 0.01 )
1582
+ assert ax .get_xlim3d () == pytest .approx (xlim , abs = 0.01 )
1583
+ assert ax .get_ylim3d () == pytest .approx (ylim , abs = 0.01 )
1584
+ assert ax .get_zlim3d () == pytest .approx (zlim , abs = 0.01 )
1583
1585
1584
1586
1585
1587
@mpl .style .context ('default' )
0 commit comments