Improve text width calculation precision (#1408)

In some extreme cases (~30000 chars) text width precision takes a hit.
Using double instead of float fixes that.
This commit is contained in:
Guldoman
2023-08-19 12:38:35 +08:00
committed by takase1121
parent 32860c111e
commit 1d0725f904
5 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -345,7 +345,7 @@ static int f_draw_text(lua_State *L) {
size_t len;
const char *text = luaL_checklstring(L, 2, &len);
float x = luaL_checknumber(L, 3);
double x = luaL_checknumber(L, 3);
int y = luaL_checknumber(L, 4);
RenColor color = checkcolor(L, 5, 255);
x = rencache_draw_text(&window_renderer, fonts, text, len, x, y, color);