enthought/chaco — pull request #98 by tonysyu (2013-02-22 18:47:57+00:00)
Title: Fix resizing bug in range_selection tool

Resizing didn't save a mouse-down point. This, combined with that fact that selections below the `minimum_selection` size get deselected resulted in strange errors. For example, open up the [range selection demo](https://github.com/enthought/chaco/blob/master/examples/demo/range_selection_demo.py) and make a selection. Then save a mouse-down point by moving the selection a little bit (click within selection at x0 and drag to x0 + eps). Now, try to resize one of the edges to x0. The selection disappears because the difference between the *saved* mouse-down point and the mouse-release point is small.

Also, since resizing doesn't save a mouse-down point, you could end up accessing the down point before its ever initialized. (I think this requires manually setting the event state to "selected"). For example, if you open the [trait editor demo](https://github.com/enthought/chaco/blob/master/examples/demo/chaco_trait_editor.py), and try to resize it, it will throw exceptions. Note the resize must be the first operation you try since moving the selection actually saves a down point.