Commit c55545a
committed
ENH: Scroll to zoom
Implements a minimal version of matplotlib#20317, in particular https://github
.com/matplotlib/pull/20317#issuecomment-2233156558:
When any of the axes manipulation tools is active (pan or zoom tool), a
mouse scroll results in a zoom towards the cursor, keeping aspect ratio.
I've decided to require an active manipulation tool, so that without any
active tool the plot cannot be changed (accidentally) - as before.
For convenience, scroll-to-zoom is allowed with both the zoom and pan
tools. Limiting further feels unnecessarily restrictive.
Zooming is also limited to not having a modifier key pressed. This is
because we might later want to add scroll+modifiers for other operations
. It's better for now not to react to these at all to not introduce
behaviors we later want to change.1 parent a5e1f60 commit c55545a
1 file changed
+43
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2574 | 2574 | | |
2575 | 2575 | | |
2576 | 2576 | | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
2577 | 2617 | | |
2578 | 2618 | | |
2579 | 2619 | | |
| |||
2653 | 2693 | | |
2654 | 2694 | | |
2655 | 2695 | | |
| 2696 | + | |
2656 | 2697 | | |
2657 | 2698 | | |
2658 | 2699 | | |
2659 | 2700 | | |
2660 | 2701 | | |
| 2702 | + | |
| 2703 | + | |
2661 | 2704 | | |
2662 | 2705 | | |
2663 | 2706 | | |
| |||
0 commit comments