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

freetype rotation rendering bugfix #630

Merged
merged 1 commit into from Nov 23, 2018
Merged

freetype rotation rendering bugfix #630

merged 1 commit into from Nov 23, 2018

Conversation

@CAIQT
Copy link

@CAIQT CAIQT commented Nov 20, 2018

The bug #629 is caused by the mistaken cache key calculation.

@CAIQT CAIQT changed the title Fix issue #629 freetype rotation rendering bug Nov 20, 2018
@CAIQT CAIQT changed the title freetype rotation rendering bug freetype rotation rendering bugfix Nov 21, 2018
@dlon
dlon approved these changes Nov 22, 2018
Copy link
Member

@dlon dlon left a comment

Unrelated: I also found that it segfaults for (large) negative angles, but that happened before as well.

@@ -63,7 +63,7 @@ set_node_key(NodeKey *key, GlyphIndex_t id, const FontRenderMode *mode)
KeyFields *fields = &key->fields;
const FT_UInt16 style_mask = ~(FT_STYLE_UNDERLINE);
const FT_UInt16 rflag_mask = ~(FT_RFLAG_VERTICAL | FT_RFLAG_KERNING);
unsigned short rot = (unsigned short)FX6_TRUNC(mode->rotation_angle);
unsigned short rot = (unsigned short)(((unsigned int)(mode->rotation_angle))>>16);

This comment has been minimized.

@dlon

dlon Nov 22, 2018
Member

Might be cleaner or more consistent to use a macro? #define FX16_TRUNC(x) ((x) >> 16)

@illume
Copy link
Member

@illume illume commented Nov 23, 2018

For the large angles, perhaps we could use a mod function on the angle first.

>>> -10810 % 360
350
@illume illume merged commit 1306b4b into pygame:master Nov 23, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dlon dlon mentioned this pull request Mar 23, 2019
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants