Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de21925

Browse files
anntzertacaswell
authored andcommitted
Reparametrize offsetbox calculations in terms of bboxes.
Passing a single bbox instead of (xdescent, ydescent, width, height) separately is easier to follow (see e.g. the changes in VPacker and HPacker, which no longer have to repeatedly pack/unpack whd_list), and avoids having to figure out e.g. the sign of the descents and whether width/height includes the descents, for example. Currently get_offset keeps a back compatible signature (we *could* consider killing the old signature but let's not do that for now), and _get_bbox_and_child_offsets is private because I *may* want to later also change the convention to make offsets relative to the bbox (0, 0) point rather than the bbox lower-left corner.
1 parent a1da538 commit de21925

File tree

4 files changed

+175
-155
lines changed

4 files changed

+175
-155
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
``OffsetBox.get_extent_offsets`` and ``OffsetBox.get_extent``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... are deprecated; these methods are also deprecated on all subclasses of
4+
`.OffsetBox`.
5+
6+
To get the offsetbox extents, instead of ``get_extent``, use
7+
`.OffsetBox.get_bbox`, which directly returns a `.Bbox` instance.
8+
9+
To also get the child offsets, instead of ``get_extent_offsets``, separately
10+
call `~.OffsetBox.get_offset` on each children after triggering a draw.

0 commit comments

Comments
 (0)