mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-11 02:19:56 -06:00
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:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user