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

doc: Center text on line in content shape example #674

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

bjoluc
Copy link
Contributor

@bjoluc bjoluc commented Aug 9, 2024

It took me a while to figure out why the text in the content example

line((0, 0), (3, 1), name: "line")
content(
  ("line.start", 0.5, "line.end"),
  angle: "line.end",
  padding: .1,
  anchor: "south",
  [Text on a line]
)

was not centered above the line. I suppose centering is a very common use case (maybe even intended in the example?), so I'd suggest using 50% here to save folks some time figuring out that 0.5 is not a percentage but an absolute length 🙂

@johannes-wolf
Copy link
Member

Thank you! In older versions of cetz, floats between 0.0 and 1.0 were used for interpolation instead of ratios. The example has not been updated since.

@johannes-wolf johannes-wolf merged commit c52b987 into cetz-package:master Aug 9, 2024
1 check failed
@johannes-wolf johannes-wolf self-requested a review August 9, 2024 18:12
@johannes-wolf johannes-wolf added the documentation Improvements or additions to documentation label Aug 9, 2024
@bjoluc bjoluc deleted the patch-1 branch August 9, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants