(self, event)
| 670 | super().trigger(sender, event, data) |
| 671 | |
| 672 | def scroll_zoom(self, event): |
| 673 | # https://gist.github.com/tacaswell/3144287 |
| 674 | if event.inaxes is None: |
| 675 | return |
| 676 | |
| 677 | if event.button == 'up': |
| 678 | # deal with zoom in |
| 679 | scl = self.base_scale |
| 680 | elif event.button == 'down': |
| 681 | # deal with zoom out |
| 682 | scl = 1/self.base_scale |
| 683 | else: |
| 684 | # deal with something that should never happen |
| 685 | scl = 1 |
| 686 | |
| 687 | ax = event.inaxes |
| 688 | ax._set_view_from_bbox([event.x, event.y, scl]) |
| 689 | |
| 690 | # If last scroll was done within the timing threshold, delete the |
| 691 | # previous view |
| 692 | if (time.time()-self.lastscroll) < self.scrollthresh: |
| 693 | self.toolmanager.get_tool(_views_positions).back() |
| 694 | |
| 695 | self.figure.canvas.draw_idle() # force re-draw |
| 696 | |
| 697 | self.lastscroll = time.time() |
| 698 | self.toolmanager.get_tool(_views_positions).push_current() |
| 699 | |
| 700 | |
| 701 | class ToolZoom(ZoomPanBase): |
nothing calls this directly
no test coverage detected