anathema/anathema — pull request #207 by curttasker (2012-04-28 06:35:21+00:00)
Title: Refactor/Rewrite of Charm Cascade Zooming

Fixes #205, where the charm cascade would inadvertently flip along the horizontal axis when the user used the mousewheel to zoom out too fast. Mostly happened on devices with inertial scrolling, trackpads, and some mice with really good mousewheels.

Also did a complete refactor/rewrite of charm cascade zooming in general. Key points:

- Moved the right-click zoom and mousewheel zoom code into the same class.
- Changed right-click zoom to live render the new cascade as the mouse is moved, rather than when the user lets go of the right mouse button.
- Refactored the code for both zoom types to be identical.
- Smoothed out zooming for both types by using smaller zoom increments (5% instead of 20%).
- Removed a lot of cruft in the zooming code; some was due to the change to live rendering right-click zoom, others were things that were just not being used.
- Changed the max zoom-out level to 50% from 65%
- Added a max zoom-in level of 1200%.
- Added help text to the cascade window. It tells the user how to pan, zoom, and reset the cascade position.

On the zoom levels, the primary reason I wanted a max is that I've often zoomed in thousands of percent (accidentally), and it was very difficult to find my way back. The 1200% leve was arrived at through much testing, as I originally started at 300%. The discovery of the hidden double-right click to reset functionality was surprising, and I found the functionality so useful I added some help text to help our users find out about it.

### Outstanding Issues

The only real issue I still have with the system is that the zoom levels are tied to the size of the charm cascade draw area, rather than the size of individual charm boxes. That is, 100% zoom is considered to be the size of the window as drawn when you first start the cascade. Resizing the window sets a new 100% zoom to that size.

The issue is that for trees with large amounts of on-screen charms (Melee), the 100% zoom size of a charm box is very small, compared to a smaller tree (Stealth) where the 100% zoom size of a charm box is markedly larger. Ideally, I'd like the charm boxes to all be a constant size at 100%, and have the zoom levels scale off of that.

### Testing

- I ran a copy of Anathema 4.1.0 release alongside this build, and tested several mice with both builds back to back, to ensure there were no major differences.
- Mice tested with: mac touchpad with inertial scrolling, a mac magic mouse, a modern logitech gaming mouse with a scroll wheel that you can flick and it spins for 30 seconds or so, and an ancient logitech wheel mouse that you flick and it the wheel only clicks 4-5 times tops.

In every case, I judge the zooming for both mousewheel and right-click & drag to be superior to what we had before.