mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Rename all cases of 'pixel density' to 'DPI scale' in love's APIs.
--HG-- branch : minor
This commit is contained in:
@@ -82,8 +82,8 @@ int w_newTrueTypeRasterizer(lua_State *L)
|
||||
luax_catchexcept(L, [&](){ t = instance()->newTrueTypeRasterizer(size, hinting); });
|
||||
else
|
||||
{
|
||||
float pixeldensity = (float) luaL_checknumber(L, 3);
|
||||
luax_catchexcept(L, [&](){ t = instance()->newTrueTypeRasterizer(size, pixeldensity, hinting); });
|
||||
float dpiscale = (float) luaL_checknumber(L, 3);
|
||||
luax_catchexcept(L, [&](){ t = instance()->newTrueTypeRasterizer(size, dpiscale, hinting); });
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -113,9 +113,9 @@ int w_newTrueTypeRasterizer(lua_State *L)
|
||||
}
|
||||
else
|
||||
{
|
||||
float pixeldensity = (float) luaL_checknumber(L, 4);
|
||||
float dpiscale = (float) luaL_checknumber(L, 4);
|
||||
luax_catchexcept(L,
|
||||
[&]() { t = instance()->newTrueTypeRasterizer(d, size, pixeldensity, hinting); },
|
||||
[&]() { t = instance()->newTrueTypeRasterizer(d, size, dpiscale, hinting); },
|
||||
[&](bool) { d->release(); }
|
||||
);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ int w_newBMFontRasterizer(lua_State *L)
|
||||
|
||||
filesystem::FileData *d = filesystem::luax_getfiledata(L, 1);
|
||||
std::vector<image::ImageData *> images;
|
||||
float pixeldensity = (float) luaL_optnumber(L, 3, 1.0);
|
||||
float dpiscale = (float) luaL_optnumber(L, 3, 1.0);
|
||||
|
||||
if (lua_istable(L, 2))
|
||||
{
|
||||
@@ -163,7 +163,7 @@ int w_newBMFontRasterizer(lua_State *L)
|
||||
}
|
||||
|
||||
luax_catchexcept(L,
|
||||
[&]() { t = instance()->newBMFontRasterizer(d, images, pixeldensity); },
|
||||
[&]() { t = instance()->newBMFontRasterizer(d, images, dpiscale); },
|
||||
[&](bool) { d->release(); for (auto id : images) id->release(); }
|
||||
);
|
||||
|
||||
@@ -181,9 +181,9 @@ int w_newImageRasterizer(lua_State *L)
|
||||
image::ImageData *d = luax_checktype<image::ImageData>(L, 1);
|
||||
std::string glyphs = luax_checkstring(L, 2);
|
||||
int extraspacing = (int) luaL_optinteger(L, 3, 0);
|
||||
float pixeldensity = (float) luaL_optnumber(L, 4, 1.0);
|
||||
float dpiscale = (float) luaL_optnumber(L, 4, 1.0);
|
||||
|
||||
luax_catchexcept(L, [&](){ t = instance()->newImageRasterizer(d, glyphs, extraspacing, pixeldensity); });
|
||||
luax_catchexcept(L, [&](){ t = instance()->newImageRasterizer(d, glyphs, extraspacing, dpiscale); });
|
||||
|
||||
luax_pushtype(L, t);
|
||||
t->release();
|
||||
|
||||
Reference in New Issue
Block a user