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

Generalise Text::angle() logic #777

Merged

Conversation

wawuwo
Copy link
Contributor

@wawuwo wawuwo commented Jun 20, 2024

Hi!

I've rewritten Text::angle() to make it generic and able to handle any combination of mCos and mSin values. Before that Text::angle() could handle only three distinct cases and all other cases fell in "default", it was rather "stiff". I believe that is the reason why subcircuit symbol has text with wrong rotation angle.

It looks good now (at least on my machine):
image

May fix #765

@dsm
Copy link
Contributor

dsm commented Jun 20, 2024

Hi, why you don't use std::atan2 ?

It gives the exact angle and handle all quadrants.

@wawuwo
Copy link
Contributor Author

wawuwo commented Jun 21, 2024

@dsm thanks for the advice! I've rewritten it using the suggested function and the code looks much better and simpler now. The very existence of the tangent function had completely slipped out of my mind somehow and I chose that straightforward approach.

@ra3xdh ra3xdh merged commit 4929b41 into ra3xdh:current Jun 21, 2024
7 checks passed
@ra3xdh
Copy link
Owner

ra3xdh commented Jun 21, 2024

Thanks for the fix! Merged.

@wawuwo wawuwo deleted the fix-765-wrong-text-angle-in-subcircuit-symbol branch June 25, 2024 15:44
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.

Sub-circuit Text Displayed
3 participants