-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mark: Support placing marks post-transform (#493)
This allows placing marks _after_ the path got transformed. Use-Case: drawing marks on scaled paths, drawing marks insides plots (which use a scaled viewport). The behavior is disabled by default and can be enabled by setting marks `post-transform` style key to `true`. Maybe the implementation has too much copied code, but doing the transform insides `mark.typ` is also not that clean I think.
- Loading branch information
1 parent
4b203d1
commit b55f085
Showing
11 changed files
with
98 additions
and
42 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
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,29 @@ | ||
#import "/src/lib.typ": * | ||
#import "/tests/helper.typ": * | ||
|
||
#test-case({ | ||
import cetz.draw: * | ||
|
||
set-style(mark: (transform-shape: true)) | ||
|
||
scale(x: 3) | ||
line((-1,-1), (1,1), mark: (start: "rect", end: "]")) | ||
}) | ||
|
||
#test-case({ | ||
import cetz.draw: * | ||
|
||
set-style(mark: (transform-shape: false)) | ||
|
||
scale(x: 3) | ||
line((-1,-1), (1,1), mark: (start: "rect", end: ">")) | ||
}) | ||
|
||
#test-case({ | ||
import cetz.draw: * | ||
|
||
set-style(mark: (transform-shape: false)) | ||
|
||
rotate(45deg) | ||
line((-1,-1), (1,-1), (1,1), mark: (start: "rect", end: "rect", scale: 3)) | ||
}) |
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