From 9d1009e4bec02ae1dcc00d5e3065c1e939b480b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szieberth=20=C3=81d=C3=A1m?= Date: Mon, 10 Oct 2022 00:02:53 +0200 Subject: [PATCH] avoid leading spaces in `text_rectangle_bounds` --- examples/text/text_rectangle_bounds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c index d2c992dfd269..9ae2ba938cb0 100644 --- a/examples/text/text_rectangle_bounds.c +++ b/examples/text/text_rectangle_bounds.c @@ -263,6 +263,6 @@ static void DrawTextBoxedSelectable(Font font, const char *text, Rectangle rec, } } - textOffsetX += glyphWidth; + if ((textOffsetX != 0) || (codepoint != ' ')) textOffsetX += glyphWidth; // avoid leading spaces } -} \ No newline at end of file +}