ngl: Fix a rounding error in subpixel positioning

1024 / 4 is 256, not 250.
This commit is contained in:
Matthias Clasen 2021-03-19 23:18:43 -04:00
parent bd0df03248
commit 7a56aa910e

View File

@ -176,10 +176,10 @@ render_glyph (cairo_surface_t *surface,
glyph_info.glyph = key->glyph; glyph_info.glyph = key->glyph;
glyph_info.geometry.width = value->ink_rect.width * 1024; glyph_info.geometry.width = value->ink_rect.width * 1024;
if (glyph_info.glyph & PANGO_GLYPH_UNKNOWN_FLAG) if (glyph_info.glyph & PANGO_GLYPH_UNKNOWN_FLAG)
glyph_info.geometry.x_offset = 250 * key->xshift; glyph_info.geometry.x_offset = 256 * key->xshift;
else else
glyph_info.geometry.x_offset = 250 * key->xshift - value->ink_rect.x * 1024; glyph_info.geometry.x_offset = 256 * key->xshift - value->ink_rect.x * 1024;
glyph_info.geometry.y_offset = 250 * key->yshift - value->ink_rect.y * 1024; glyph_info.geometry.y_offset = 256 * key->yshift - value->ink_rect.y * 1024;
glyph_string.num_glyphs = 1; glyph_string.num_glyphs = 1;
glyph_string.glyphs = &glyph_info; glyph_string.glyphs = &glyph_info;