-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Content Intersections (#386)
- Adds intersection checking for `content` elements by setting their `segments` to their frame (defaulting to a rectangle) - Fixes a bug in `line` intersection checking, taking the furthest intersection for one side and the nearest for the other This changes `intersection` to _not_ emit anchors for intersections of one element's drawables with each other (e.g. an element with 2 drawables or marks did emit self intersections prior to this change!). See the grid intersection example (ref image), which should _not_ emit intersections.
- Loading branch information
1 parent
2abf154
commit b31d6af
Showing
9 changed files
with
99 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#set page(width: auto, height: auto) | ||
#import "/src/lib.typ": * | ||
#import "/tests/helper.typ": * | ||
|
||
#test-case({ | ||
import draw: * | ||
set-style(fill: gray, stroke: gray) | ||
|
||
intersections("i", { | ||
content((0,0), [Text]) | ||
on-layer(-1, { | ||
line((1,1), (-1,-1)) | ||
bezier((-1,0), (1,0), (-.5,.5), (.5,-.5), fill: none) | ||
}) | ||
}) | ||
on-layer(-1, { | ||
for-each-anchor("i", n => { | ||
circle("i." + n, radius: .05) | ||
}) | ||
}) | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters