mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-12 18:10:35 +01:00
Merge branch 'issue-390-workaround' into 'master'
Draft: Account for rounding when subpixel positioning See merge request cairo/cairo!485
This commit is contained in:
commit
4e8be5a940
1 changed files with 10 additions and 0 deletions
|
|
@ -2231,6 +2231,11 @@ _cairo_scaled_font_single_glyph_device_extents (cairo_scaled_font_t *scaled_fon
|
|||
box.p2.y = v + scaled_glyph->bbox.p2.y;
|
||||
|
||||
_cairo_box_round_to_rectangle (&box, extents);
|
||||
|
||||
/* Modify the extents to account for the rounding */
|
||||
extents->y -= 1;
|
||||
extents->width += 1;
|
||||
extents->height += 1;
|
||||
}
|
||||
_cairo_scaled_font_thaw_cache (scaled_font);
|
||||
return status;
|
||||
|
|
@ -2317,6 +2322,11 @@ _cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font,
|
|||
|
||||
if (box.p1.x < box.p2.x) {
|
||||
_cairo_box_round_to_rectangle (&box, extents);
|
||||
|
||||
/* Modify the extents to account for the rounding */
|
||||
extents->y -= 1;
|
||||
extents->width += 1;
|
||||
extents->height += 1;
|
||||
} else {
|
||||
extents->x = extents->y = 0;
|
||||
extents->width = extents->height = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue