Use x offset to define render command rect in rencache_draw_text (#1618)

* Return x offset for the first character in `ren_font_group_get_width`

* Use x offset to define render command rect in `rencache_draw_text`
This commit is contained in:
Guldoman
2023-11-30 11:45:25 +08:00
committed by takase1121
parent 9be5a46a22
commit bc935906d1
4 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ static int f_font_get_width(lua_State *L) {
size_t len;
const char *text = luaL_checklstring(L, 2, &len);
lua_pushnumber(L, ren_font_group_get_width(&window_renderer, fonts, text, len));
lua_pushnumber(L, ren_font_group_get_width(&window_renderer, fonts, text, len, NULL));
return 1;
}