game.draw was broken for text

This commit is contained in:
mid 2025-02-09 22:23:54 +02:00
parent 6f2a27c03f
commit 2bf947018c

View File

@ -1864,6 +1864,10 @@ static int dagame_draw(lua_State *L) {
} else { } else {
lua_pop(L, 1); lua_pop(L, 1);
lua_getfield(L, 1, "font");
struct k3Font *font = *(void**) lua_touserdata(L, -1);
lua_pop(L, 1);
lua_getfield(L, 1, "align"); lua_getfield(L, 1, "align");
lua_getfield(L, 1, "r"); lua_getfield(L, 1, "r");
@ -1878,9 +1882,6 @@ static int dagame_draw(lua_State *L) {
lua_getfield(L, 1, "x"); lua_getfield(L, 1, "x");
lua_getfield(L, 1, "y"); lua_getfield(L, 1, "y");
lua_getfield(L, 1, "font");
struct k3Font *font = *(void**) lua_touserdata(L, 1);
struct k3RectF rect; struct k3RectF rect;
k3FontSz(font, lua_tonumber(L, -4), lua_tostring(L, -3), &rect); k3FontSz(font, lua_tonumber(L, -4), lua_tostring(L, -3), &rect);