Added in a float for rencache.

This commit is contained in:
Adam Harrison 2021-09-25 12:55:20 -04:00
parent b17aa3b068
commit 8816131780
1 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@ typedef struct {
RenRect rect; RenRect rect;
RenColor color; RenColor color;
RenFont *font; RenFont *font;
float text_x;
char text[0]; char text[0];
} Command; } Command;
@ -139,6 +140,7 @@ float rencache_draw_text(lua_State *L, RenFont *font, const char *text, float x,
cmd->color = color; cmd->color = color;
cmd->font = font; cmd->font = font;
cmd->rect = rect; cmd->rect = rect;
cmd->text_x = x;
cmd->tab_size = ren_font_get_tab_size(font); cmd->tab_size = ren_font_get_tab_size(font);
} }
} }
@ -247,7 +249,7 @@ void rencache_end_frame(lua_State *L) {
break; break;
case DRAW_TEXT: case DRAW_TEXT:
ren_font_set_tab_size(cmd->font, cmd->tab_size); ren_font_set_tab_size(cmd->font, cmd->tab_size);
ren_draw_text(cmd->font, cmd->text, cmd->rect.x, cmd->rect.y, cmd->color); ren_draw_text(cmd->font, cmd->text, cmd->text_x, cmd->rect.y, cmd->color);
break; break;
} }
} }