Commit a5bb90a
committed
Revert "Convert adjust_bbox to use ExitStack."
With the `ExitStack` and context managers, it's expected that everything
is called in pairs, i.e., `adjust_bbox` followed by `restore_bbox`. When
saving, `BackendBases.print_figure` calls `adjust_bbox` before and
`restore_bbox` after the renderer-specific method. In raster renderers,
that's all that happens.
However, in mixed mode renderers, this is not the case. When it needs to
rasterize (`MixedModeRendering.start_rasterizing`), it will change the
DPI, restore the bbox, and re-adjust again. Internally, it hangs on to
the new `restore_bbox`, but `print_figure` still has the original, which
was cleared at the first `start_rasterizing` call, so when it calls
`restore_bbox`, it does nothing because the stack is empty.
So all that means that we need to revert the original change, as it
needs to be possible to call `restore_bbox` more than once. This has not
been a direct revert, as other cleanups happened in the meantime.1 parent cb0654d commit a5bb90a
1 file changed
Lines changed: 34 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
| |||
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
33 | 54 | | |
34 | 55 | | |
35 | 56 | | |
| |||
38 | 59 | | |
39 | 60 | | |
40 | 61 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 62 | + | |
| 63 | + | |
44 | 64 | | |
45 | 65 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 66 | + | |
49 | 67 | | |
50 | | - | |
51 | 68 | | |
52 | | - | |
53 | | - | |
| 69 | + | |
54 | 70 | | |
55 | | - | |
56 | 71 | | |
57 | 72 | | |
58 | 73 | | |
59 | | - | |
| 74 | + | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
| |||
0 commit comments