diff --git a/changes.txt b/changes.txt index 256a108b7..2bbb7c89e 100644 --- a/changes.txt +++ b/changes.txt @@ -5,7 +5,6 @@ Released: N/A * Added Body:getLocalPoints. * Added Font:getKerning. -* Added a variant of Font:getWidth which takes a codepoint number argument. * Added support for r16, rg16, and rgba16 pixel formats in Canvases. * Added Shader:send(name, matrixlayout, data, ...) variant, whose argument order is more consistent than Shader:send(name, data, matrixlayout, ...). diff --git a/src/modules/graphics/wrap_Font.cpp b/src/modules/graphics/wrap_Font.cpp index e3565027a..426d68685 100644 --- a/src/modules/graphics/wrap_Font.cpp +++ b/src/modules/graphics/wrap_Font.cpp @@ -86,16 +86,8 @@ int w_Font_getHeight(lua_State *L) int w_Font_getWidth(lua_State *L) { Font *t = luax_checkfont(L, 1); - if (lua_type(L, 2) == LUA_TSTRING) - { - const char *str = luaL_checkstring(L, 2); - luax_catchexcept(L, [&](){ lua_pushinteger(L, t->getWidth(str)); }); - } - else - { - uint32 glyph = (uint32) luaL_checknumber(L, 2); - luax_catchexcept(L, [&](){ lua_pushinteger(L, t->getWidth(glyph)); }); - } + const char *str = luaL_checkstring(L, 2); + luax_catchexcept(L, [&](){ lua_pushinteger(L, t->getWidth(str)); }); return 1; }