Made width return a floating point.
This commit is contained in:
1 parent
c5fda5237f
commit
d07d0e6d22
2 files changed
+3
-3
No files matched your search
+2
-2
@@ -206,8 +206,8 @@ int ren_font_get_tab_size(RenFont *font) {
|
||||
return font_get_glyphset(font, '\t')->metrics['\t'].xadvance / font->space_advance;
|
||||
}
|
||||
|
||||
int ren_font_get_width(RenFont *font, const char *text) {
|
||||
int width = 0;
|
||||
float ren_font_get_width(RenFont *font, const char *text) {
|
||||
float width = 0;
|
||||
const char* end = text + strlen(text);
|
||||
while (text < end) {
|
||||
unsigned int codepoint;
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ RenFont* ren_font_copy(RenFont* font, float size);
|
||||
void ren_font_free(RenFont *font);
|
||||
void ren_font_set_tab_size(RenFont *font, int n);
|
||||
int ren_font_get_tab_size(RenFont *font);
|
||||
int ren_font_get_width(RenFont *font, const char *text);
|
||||
float ren_font_get_width(RenFont *font, const char *text);
|
||||
int ren_font_get_height(RenFont *font);
|
||||
float ren_font_get_size(RenFont *font);
|
||||
int ren_draw_text(RenFont *font, const char *text, float x, int y, RenColor color);
|
||||
|
||||
Reference in new issue
Block a user