@@ -1660,6 +1660,7 @@ def test_toolbar_zoom_pan(tool, button, key, expected):
1660
1660
ax = fig .add_subplot (projection = '3d' )
1661
1661
ax .scatter (0 , 0 , 0 )
1662
1662
fig .canvas .draw ()
1663
+ xlim0 , ylim0 , zlim0 = ax .get_xlim3d (), ax .get_ylim3d (), ax .get_zlim3d ()
1663
1664
1664
1665
# Mouse from (0, 0) to (1, 1)
1665
1666
d0 = (0 , 0 )
@@ -1694,6 +1695,22 @@ def test_toolbar_zoom_pan(tool, button, key, expected):
1694
1695
assert ax .get_ylim3d () == pytest .approx (ylim , abs = 0.01 )
1695
1696
assert ax .get_zlim3d () == pytest .approx (zlim , abs = 0.01 )
1696
1697
1698
+ # Ensure that back, forward, and home buttons work
1699
+ tb .back ()
1700
+ assert ax .get_xlim3d () == pytest .approx (xlim0 , abs = 0.0001 )
1701
+ assert ax .get_ylim3d () == pytest .approx (ylim0 , abs = 0.0001 )
1702
+ assert ax .get_zlim3d () == pytest .approx (zlim0 , abs = 0.0001 )
1703
+
1704
+ tb .forward ()
1705
+ assert ax .get_xlim3d () == pytest .approx (xlim , abs = 0.01 )
1706
+ assert ax .get_ylim3d () == pytest .approx (ylim , abs = 0.01 )
1707
+ assert ax .get_zlim3d () == pytest .approx (zlim , abs = 0.01 )
1708
+
1709
+ tb .home ()
1710
+ assert ax .get_xlim3d () == pytest .approx (xlim0 , abs = 0.0001 )
1711
+ assert ax .get_ylim3d () == pytest .approx (ylim0 , abs = 0.0001 )
1712
+ assert ax .get_zlim3d () == pytest .approx (zlim0 , abs = 0.0001 )
1713
+
1697
1714
1698
1715
@mpl .style .context ('default' )
1699
1716
@check_figures_equal (extensions = ["png" ])
0 commit comments