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: Add anchor style to shift marks #584

Merged
merged 2 commits into from
May 18, 2024
Merged

Conversation

johannes-wolf
Copy link
Member

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

@fenjalien Not sure about the name origin. The idea is to have a style key that shifts the
mark origin along its (local) x-axis: 0% tip, 100% base.

  • Add documentation
  • Add changelog

Fixes #578.

@fenjalien
Copy link
Member

Would it be easier to add anchors to the mark function? "tip", "center" and "inset" (or "base") could work

@johannes-wolf
Copy link
Member Author

johannes-wolf commented May 11, 2024

Would it be easier to add anchors to the mark function? "tip", "center" and "inset" (or "base") could work

As an addition? Because this feature is also useful when placing a mark on a path, e.g., in the center.

@fenjalien
Copy link
Member

No, instead of using the origin styling parameter. Anchors would functionally do the same thing but with predefined positions. Given the normal size of marks I don't think you would want such fine control it.

@arkadiuszwojcik
Copy link

@fenjalien in such case how it would look like if I would like to use mark center as placement origin?

@johannes-wolf
Copy link
Member Author

mark(..., anchor: "center"), I guess.

@johannes-wolf
Copy link
Member Author

Changed. You can now specify one of the anchors tip, center and base to place the mark at. This also works with marks on paths.

@johannes-wolf johannes-wolf force-pushed the shift-mark-origin branch 2 times, most recently from 73aeea2 to 95c93e6 Compare May 13, 2024 15:17
@johannes-wolf johannes-wolf changed the title mark: Add offset style to shift marks mark: Add anchor style to shift marks May 13, 2024
src/styles.typ Outdated Show resolved Hide resolved
@johannes-wolf
Copy link
Member Author

Can we merge this?

@johannes-wolf johannes-wolf merged commit 50e061c into master May 18, 2024
1 check passed
@johannes-wolf johannes-wolf deleted the shift-mark-origin branch May 18, 2024 20:45
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.

Mark positioning
3 participants