Envelopes: document how a straight segment's handles count in the top object corner test

A top object's corner test treats a straight segment as having its
handles a third of the way along it, so an anchor between two straight
segments is a corner only when it turns out of the outline. docs/mcp.md
and the doc comment now say so, and a new test covers an inward anchor
between straight segments. The bulging-curve corner test checks against
a fixed point instead of the same nearest-point routine the code uses.
This commit is contained in:
dotCooCoo
2026-11-09 00:31:07 +07:00
committed by bflatastic
parent ed6c0d434f
commit 51bab66409
3 changed files with 21 additions and 7 deletions
+3 -1
View File
@@ -6619,7 +6619,9 @@ arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise,
A top object's outline is split into four sides at four corners. Each corner is the anchor nearest a corner of the
outline's bounding box among the anchors within 47.5% of the box's width and height from that box corner that count as
corners: an anchor with a handle 0.01 pt long or shorter, or one whose tangent unit vectors differ by 0.01 or more in
x or y and turn out of the outline. On a tie, the anchor met first along the outline in the order it was drawn wins.
x or y and turn out of the outline. In this test a straight segment counts as having its handles a third of the way
along it, so an anchor between two straight segments longer than 0.03 pt is a corner only when it turns out of the
outline. On a tie, the anchor met first along the outline in the order it was drawn wins.
Without such an anchor, the corner is the outline's point nearest the box corner, moved onto the anchor at the end of
its segment when within 0.5% of the segment's parameter. Each piece of a side between anchors and corners takes a
share of the content's width or height in proportion to the length of its control polygon, spread along the piece by