-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Improve viewport rotation gizmo drawing #93639
Conversation
passivestar
commented
Jun 26, 2024
- More accurate text placement, using Vector2 to avoid loss of precision
- Don't draw lines under the circles
- Enable antialiasing
- Use slightly smaller font size so letters don't get too close to the edge
- Limit text alpha to avoid pitch black
- Use brighter axis color on hover instead of pure white
- Use remap for alpha calculation so that foreground axes stay opaque longer
- Slightly reduce minimum possible alpha for better depth separation
- Thicker lines
Before | After |
---|---|
efbf6ba
to
a9ef6cd
Compare
Is it difficult for you to make a side by side video? It might help the nontechnical to provide comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected. Code looks good to me.
Great work!
Preview with Inter as the editor font:
gizmo_new.mp4
200% editor scale with the default font:
gizmo_new_2x.mp4
The only issue I can notice is that with certain custom fonts (as shown above), the X/Y/Z labels can be slightly off-center. I'm not sure if much can be done about this. (For reference, this issue was already present before your PR.)
One option could be to replace the manual draw labels in editor font with a custom SVG for X, Y, Z well centered in the circle. There might still be issues depending on the scale used in the editor for scaling up/down the SVG, but at least we can ensure it's using the same font and metrics won't mess it up. Alternatively, we could draw these labels with the default editor font regardless of custom fonts defined by the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. This is pretty low risk so should be fine to include in 4.3 despite the feature freeze.
Thanks! |