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

osgText::TextBase function computePositionsImplementation() set "_offset" as a worng value. #1349

Open
ChenKe404 opened this issue Jan 7, 2025 · 2 comments

Comments

@ChenKe404
Copy link

I have create a osgText::Text object with empty text and setAlignment as LEFT_BOTTOM_BASE_LINE, then getBoundingBox will get a very large Y value.
I maybe found the reason right here:
image
The member "_lineCount" type is "unsignel int", it will be 0 when text is empty, unsigned 0 - 1 will got a very large positive number.
member "_offset" will be make transalte for member "_matrix", and the "_matrix" will be use at computeBoundingBox.

OSG Version: 3.6.5

@robertosfield
Copy link
Collaborator

That does look like a bug, with the code assuming that _lineCount is >= 1, changing the code to check for this condition, or use a min(_lineCount, 1) in stead of the _lineCount would resolve this issue.

@ChenKe404
Copy link
Author

Thanks for your reply, and I wonder if you will still release a version to fix known bugs? or just fix these issue by ourselves?

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

No branches or pull requests

2 participants