diff options
| author | raysan5 <[email protected]> | 2021-12-28 15:39:57 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2021-12-28 15:39:57 +0100 |
| commit | 803ce9f44be74766b7b618fa51d26e5f003dea81 (patch) | |
| tree | bd3ae0a8818da2dfe8d34a3e525fc376780ecb20 /src/rtext.c | |
| parent | 611e54e67ebbdcc4250719a2e430390eccb72440 (diff) | |
| download | raylib-803ce9f44be74766b7b618fa51d26e5f003dea81.tar.gz raylib-803ce9f44be74766b7b618fa51d26e5f003dea81.zip | |
Detected some pixel-errors due to rounding issues on position
Diffstat (limited to 'src/rtext.c')
| -rw-r--r-- | src/rtext.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rtext.c b/src/rtext.c index c8367af7..a65f8e7f 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -922,8 +922,8 @@ void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSiz // Character destination rectangle on screen // NOTE: We consider glyphPadding on drawing - Rectangle dstRec = { position.x + font.glyphs[index].offsetX*scaleFactor - (float)font.glyphPadding*scaleFactor, - position.y + font.glyphs[index].offsetY*scaleFactor - (float)font.glyphPadding*scaleFactor, + Rectangle dstRec = { (int)position.x + font.glyphs[index].offsetX*scaleFactor - (float)font.glyphPadding*scaleFactor, + (int)position.y + font.glyphs[index].offsetY*scaleFactor - (float)font.glyphPadding*scaleFactor, (font.recs[index].width + 2.0f*font.glyphPadding)*scaleFactor, (font.recs[index].height + 2.0f*font.glyphPadding)*scaleFactor }; |
