Use Lua string length instead of relying on strlen (#1262)

This allows us to render `NULL` byte sequences and not truncate strings 
that contain them.
This commit is contained in:
Guldoman
2022-12-26 13:49:07 -04:00
committed by GitHub
parent 18e3542be0
commit c29b1c2cb9
5 changed files with 20 additions and 14 deletions
+2 -2
View File
@@ -28,8 +28,8 @@ int ren_font_group_get_height(RenFont **font);
float ren_font_group_get_size(RenFont **font);
void ren_font_group_set_size(RenFont **font, float size);
void ren_font_group_set_tab_size(RenFont **font, int n);
float ren_font_group_get_width(RenFont **font, const char *text);
float ren_draw_text(RenFont **font, const char *text, float x, int y, RenColor color);
float ren_font_group_get_width(RenFont **font, const char *text, size_t len);
float ren_draw_text(RenFont **font, const char *text, size_t len, float x, int y, RenColor color);
void ren_draw_rect(RenRect rect, RenColor color);