-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hide: Add hide function for hiding elements
- Loading branch information
1 parent
3453946
commit ad44c2a
Showing
9 changed files
with
98 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#import "draw/grouping.typ": intersections, group, anchor, copy-anchors, place-anchors, set-ctx, get-ctx, for-each-anchor, on-layer, place-marks | ||
#import "draw/grouping.typ": intersections, group, anchor, copy-anchors, place-anchors, set-ctx, get-ctx, for-each-anchor, on-layer, place-marks, hide | ||
#import "draw/transformations.typ": set-transform, rotate, translate, scale, set-origin, move-to, set-viewport | ||
#import "draw/styling.typ": set-style, fill, stroke | ||
#import "draw/shapes.typ": circle, circle-through, arc, arc-through, mark, line, grid, content, rect, bezier, bezier-through, catmull, hobby, merge-path |
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
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,37 @@ | ||
#set page(width: auto, height: auto) | ||
#import "/src/lib.typ": * | ||
|
||
#box(stroke: 2pt + red, canvas({ | ||
import draw: * | ||
rect((0,0), (5,5)) | ||
|
||
// Hide a circle | ||
hide(circle((6,6))) | ||
|
||
// Hide content | ||
hide(content((-6,-6), [Hidden])) | ||
|
||
// Hide multiple elements | ||
hide({ | ||
rect((0,0), (1,1)) | ||
rect((1,1), (2,2)) | ||
rect((2,2), (3,3)) | ||
}) | ||
|
||
// Use hidden anchor | ||
hide(line((0,0), (2.5, 2.5), name: "line")) | ||
content("line.end", [Hidden anchor]) | ||
})) | ||
|
||
#box(stroke: 2pt + red, canvas({ | ||
import draw: * | ||
|
||
merge-path({ | ||
arc((0,0), start: 0deg, stop: 180deg) | ||
hide({ | ||
// This gets ignored | ||
line((), (rel: (-5,0), update: false)) | ||
}) | ||
line((), (rel: (1, -1))) | ||
}, close: true) | ||
})) |