Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-10-05 08:22:47 +03:00
parent 4d8940812a
commit 9268380fd9
3 changed files with 88 additions and 1 deletions

View File

@@ -164,8 +164,10 @@ auto TextRenderer::generate_glyph(FontRuntime &rt, FontData &fd,
msdfgen::Bitmap<float, 3> msdf_bitmap(bmp_w, bmp_h);
msdfgen::Vector2 scale_vec(scale, scale);
double const inv_scale = 1.0 / scale;
msdfgen::Vector2 translate(
-bounds.l * scale + rt.px_range, -bounds.b * scale + rt.px_range);
-bounds.l + rt.px_range * inv_scale,
-bounds.b + rt.px_range * inv_scale);
msdfgen::generateMSDF(msdf_bitmap, shape, rt.px_range, scale_vec, translate);
std::vector<Color> buffer(static_cast<size_t>(bmp_w) * bmp_h);