Commit 8bab597
committed
Let widgets/clabel better handle overlapping axes.
In general, using event.inaxes/event.xdata/event.ydata can be
error-prone when there are overlapping axes, because only the topmost
axes is the "in"-axes.
In the specific case of widgets/clabel, in particular, we can instead
check whether an event occurred over the axes and if so compute
xdata/ydata accordingly. Doing so allows correct handling of widgets on
axes for which there's also a twin axes on top of it.
Changes in the tests (other than the change in test_span_selector, which
tests the functionality here) ensure that the synthetic button presses
indeed occur on top of the desired axes (previously, do_event would
directly set event.inaxes and we'd just believe that "as is").1 parent 5438e94 commit 8bab597
3 files changed
+110
-103
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
646 | 653 | | |
647 | 654 | | |
648 | 655 | | |
| |||
925 | 932 | | |
926 | 933 | | |
927 | 934 | | |
928 | | - | |
| 935 | + | |
929 | 936 | | |
930 | 937 | | |
931 | 938 | | |
| |||
1033 | 1040 | | |
1034 | 1041 | | |
1035 | 1042 | | |
1036 | | - | |
| 1043 | + | |
1037 | 1044 | | |
1038 | 1045 | | |
1039 | 1046 | | |
| |||
1632 | 1639 | | |
1633 | 1640 | | |
1634 | 1641 | | |
1635 | | - | |
| 1642 | + | |
| 1643 | + | |
1636 | 1644 | | |
1637 | 1645 | | |
1638 | 1646 | | |
| |||
0 commit comments