summaryrefslogtreecommitdiffhomepage
path: root/examples/text/text_rectangle_bounds.c
diff options
context:
space:
mode:
authorSzieberth Ádám <[email protected]>2022-10-11 12:14:40 +0200
committerGitHub <[email protected]>2022-10-11 12:14:40 +0200
commit4cca234f46fcdac4541ceb26b753ca5f73e8a819 (patch)
tree8dc310cf6d35755e0644760b74a035613b395231 /examples/text/text_rectangle_bounds.c
parent0d04ceafbf4892d5a11bc9f642232c331785f903 (diff)
downloadraylib-4cca234f46fcdac4541ceb26b753ca5f73e8a819.tar.gz
raylib-4cca234f46fcdac4541ceb26b753ca5f73e8a819.zip
avoid leading spaces in `text_rectangle_bounds` (#2746)
Diffstat (limited to 'examples/text/text_rectangle_bounds.c')
-rw-r--r--examples/text/text_rectangle_bounds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c
index d2c992df..9ae2ba93 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
+}