Commit a15f571
committed
Fix draggable annotations on subfigures.
- Picking on subfigures was broken because `ax = getattr(a, 'axes', None)`
would return the SubFigure.axes *list* when `a` is a subfigure, so the
axes identity test would just be completely wrong. Fix that by
special-casing subfigures. (Ideally I would entirely remove the axes
equality test because that also breaks in the case of overlapping axes,
but that's a much bigger change.)
- `ref_artist.figure._canvas_callbacks` would fail when the ref_artist
is on a subfigure because subfigures don't have a _canvas_callbacks
attribute; instead use `ref_artist.figure.canvas.callbacks` where
accessing the canvas attribute correctly goes back to the toplevel
figure first.
See test for an example (which would previously fail with an
AttributeError).1 parent 3180c94 commit a15f571
3 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
540 | | - | |
| 540 | + | |
| 541 | + | |
541 | 542 | | |
542 | 543 | | |
543 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1458 | 1458 | | |
1459 | 1459 | | |
1460 | 1460 | | |
1461 | | - | |
| 1461 | + | |
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
| |||
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
1474 | | - | |
1475 | 1474 | | |
1476 | 1475 | | |
1477 | 1476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
0 commit comments