From 803ce9f44be74766b7b618fa51d26e5f003dea81 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 28 Dec 2021 15:39:57 +0100 Subject: [PATCH] Detected some pixel-errors due to rounding issues on position --- src/rtext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index c8367af7f..a65f8e7f1 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 };