Skip to content

Adding rotation to text #120

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bellwether-softworks
Copy link

@bellwether-softworks bellwether-softworks commented Jul 2, 2025

Adding ability to specify rotation angle for Text instances.

Screenshot_20250707_063243

  • I have followed the instructions in the PR template

@bellwether-softworks bellwether-softworks changed the title Draft: Adding rotation to text Adding rotation to text Jul 2, 2025
@@ -676,6 +678,13 @@ impl Text {
self
}

/// Text rotation angle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add an explanation how to define the angle correctly

so what happens when set to 1000
Are there limitations to the. max value?

@bellwether-softworks bellwether-softworks changed the title Adding rotation to text Draft: Adding rotation to text Jul 5, 2025
@bellwether-softworks
Copy link
Author

In updating the comments, I realized that the underlying TextShape::with_angle behavior anchors to upper-left by default, and when combined with Text::anchor resulted in unintuitive behavior. I've since changed the behavior such that the TextShape rotation is performed about its center, leaving the plot element's behavior intact; this can be seen in the updated screenshot, wherein I'm hovering over the legend node to highlight the text bounding box.

@bellwether-softworks bellwether-softworks changed the title Draft: Adding rotation to text Adding rotation to text Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants