Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitde21925

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 andHPacker, which no longer have to repeatedly pack/unpack whd_list), andavoids having to figure out e.g. the sign of the descents and whetherwidth/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 lateralso change the convention to make offsets relative to the bbox (0, 0)point rather than the bbox lower-left corner.
1 parenta1da538 commitde21925

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)

[8]ページ先頭

©2009-2025 Movatter.jp