Fix scaling

not happy with having to do this, but whatever
This commit is contained in:
Kae 2023-07-03 08:57:30 +10:00
parent 398a5655f4
commit 7999442f01
2 changed files with 6 additions and 2 deletions

View File

@ -66,7 +66,6 @@ LuaAnimationComponent<Base>::LuaAnimationComponent() {
if (renderLayerName)
renderLayer = parseRenderLayer(*renderLayerName);
drawable.scale(1.0f / TilePixels);
m_drawables.append({move(drawable), renderLayer});
});
animationCallbacks.registerCallback("clearLightSources", [this]() {

View File

@ -449,7 +449,12 @@ Maybe<Drawable> LuaConverter<Drawable>::to(LuaEngine& engine, LuaValue const& v)
else if (auto poly = table->get<Maybe<PolyF>>("poly"))
drawable = Drawable::makePoly(poly.take(), color);
else if (auto image = table->get<Maybe<String>>("image"))
drawable = Drawable::makeImage(image.take(), 1.0f, table->get<Maybe<bool>>("centered").value(true), Vec2F(), color);
drawable = Drawable::makeImage(
image.take(),
table->get<Maybe<bool>>("screenSpace").value(false) ? 1.0f : 1.0f / TilePixels,
table->get<Maybe<bool>>("centered").value(true),
Vec2F(),
color);
else
return {}; // throw LuaAnimationComponentException("Drawable table must have 'line', 'poly', or 'image'");