From: <md...@us...> - 2007-09-05 15:28:23
|
Revision: 3789 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3789&view=rev Author: mdboom Date: 2007-09-05 08:28:21 -0700 (Wed, 05 Sep 2007) Log Message: ----------- Bugfix #1767997: Zoom to rectangle and home, previous, next buttons The "original" position of the axes was not being saved/restored in the history stack. This patch saves both "original" and "active" position. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backend_bases.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2007-09-05 15:23:29 UTC (rev 3788) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2007-09-05 15:28:21 UTC (rev 3789) @@ -1446,7 +1446,10 @@ xmin, xmax = a.get_xlim() ymin, ymax = a.get_ylim() lims.append( (xmin, xmax, ymin, ymax) ) - pos.append( tuple( a.get_position() ) ) + # Store both the original and modified positions + pos.append( ( + tuple( a.get_position(True) ), + tuple( a.get_position() ) ) ) self._views.push(lims) self._positions.push(pos) self.set_history_buttons() @@ -1660,7 +1663,9 @@ xmin, xmax, ymin, ymax = lims[i] a.set_xlim((xmin, xmax)) a.set_ylim((ymin, ymax)) - a.set_position( pos[i] ) + # Restore both the original and modified positions + a.set_position( pos[i][0], 'original' ) + a.set_position( pos[i][1], 'active' ) self.draw() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |