enthought/chaco — pull request #150 by tonysyu (2013-11-18 23:38:19+00:00)
Title: Fix to stop pan-induced zooming.

When the pan tool has `restrict_to_data` set to `True` and the plot has nonlinear axes, panning at the boundaries would cause the plot to zoom. Maybe this is a feature? ;)

You can reproduce the issue with the following example. Just pan around and watch your data range change (shrink in one direction and stretch in the other).

```python
import numpy as np

from enable.api import Component, ComponentEditor
from traits.api import HasTraits, Instance
from traitsui.api import UItem, View
from chaco.api import ArrayPlotData, Plot
from chaco.tools.api import PanTool

class Demo(HasTraits):

plot = Instance(Component)
view = View(UItem('plot', editor=ComponentEditor(size=(500, 500))))

def _plot_default(self):
x = np.linspace(1, 10, 200)
pd = ArrayPlotData(x=x, y=np.sin(x)+2) # Add 2 so y doesn't cross zero
plot = Plot(pd)
plot.plot(('x', 'y'), line_width=2)

plot.index_scale = 'log'
plot.value_scale = 'log'

plot.tools.append(PanTool(plot, restrict_to_data=True))
return plot

if __name__ == '__main__':
demo = Demo()
demo.configure_traits()
```