Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark: Support placing marks post-transform #493

Merged
merged 3 commits into from
Feb 20, 2024
Merged

Conversation

johannes-wolf
Copy link
Member

@johannes-wolf johannes-wolf commented Feb 11, 2024

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.

@johannes-wolf
Copy link
Member Author

johannes-wolf commented Feb 14, 2024

… or should we even do this by default (without an option)? This is what TikZ does. Marks don't get scaled with shape-transforms. What do you think @fenjalien? I'd really like to have this feature.

@johannes-wolf
Copy link
Member Author

Together with #505 this would bring marks closer to how Tikz handles them.

manual.typ Outdated Show resolved Hide resolved
src/draw/shapes.typ Outdated Show resolved Hide resolved
src/styles.typ Outdated Show resolved Hide resolved
@johannes-wolf johannes-wolf force-pushed the mark-post-transform branch 3 times, most recently from 52584ee to 36e705b Compare February 18, 2024 17:26
manual.typ Outdated Show resolved Hide resolved
src/draw/shapes.typ Outdated Show resolved Hide resolved
src/drawable.typ Outdated Show resolved Hide resolved
src/mark.typ Outdated Show resolved Hide resolved
@johannes-wolf johannes-wolf merged commit b55f085 into master Feb 20, 2024
1 check passed
@johannes-wolf johannes-wolf deleted the mark-post-transform branch February 20, 2024 10:37
johannes-wolf added a commit that referenced this pull request Feb 21, 2024
Change the default transformation matrix to have z coordinates of zero
after transformation.
This is actually a fix, as the final 2D projection should not have a
z-value other than zero.

With this change, anchors in 3D space become 2D and thus elements like
rect, Bézier or Catmull, … will correctly work when using them with
anchors to 3D elements. Intersection between 3D elements will also work
(in 2D space).


See: #502 and #493.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants