This commit is contained in:
Kovid Goyal 2018-12-03 21:35:03 +05:30
parent 3d5977669e
commit d5366a421f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -538,12 +538,14 @@ render_glyphs_in_cells(PyObject *f, bool bold, bool italic, hb_glyph_info_t *inf
} }
x_offset = x + (float)positions[i].x_offset / 64.0f; x_offset = x + (float)positions[i].x_offset / 64.0f;
y = (float)positions[i].y_offset / 64.0f; y = (float)positions[i].y_offset / 64.0f;
if ((*was_colored || self->face->glyph->metrics.width > 0) && bm.width > 0) place_bitmap_in_canvas(canvas, &bm, canvas_width, cell_height, x_offset, y, baseline); if ((*was_colored || self->face->glyph->metrics.width > 0) && bm.width > 0) {
place_bitmap_in_canvas(canvas, &bm, canvas_width, cell_height, x_offset, y, baseline);
}
x += (float)positions[i].x_advance / 64.0f; x += (float)positions[i].x_advance / 64.0f;
free_processed_bitmap(&bm); free_processed_bitmap(&bm);
} }
if (center_glyph) { if (center_glyph && num_glyphs) {
unsigned int right_edge = (unsigned int)x, delta; unsigned int right_edge = (unsigned int)x, delta;
// x_advance is wrong for colored bitmaps that have been downsampled // x_advance is wrong for colored bitmaps that have been downsampled
if (*was_colored) right_edge = num_glyphs == 1 ? bm.right_edge : canvas_width; if (*was_colored) right_edge = num_glyphs == 1 ? bm.right_edge : canvas_width;