Browse Source

avoid leading spaces in `text_rectangle_bounds` (#2746)

Szieberth Ádám 2 years ago
parent
commit
4cca234f46
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/text/text_rectangle_bounds.c

+ 2 - 2
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
     }
-}
+}