mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-02 14:30:45 +02:00
PS: Use tight bounding box
Now that the page size is specified by %%DocumentMedia we can make %%BoundingBox compliant.
This commit is contained in:
parent
e2c558c435
commit
3f5aaf6baa
1 changed files with 4 additions and 11 deletions
|
|
@ -3779,17 +3779,10 @@ _cairo_ps_surface_set_bounding_box (void *abstract_surface,
|
|||
cairo_bool_t has_page_media;
|
||||
const char *page_media;
|
||||
|
||||
if (surface->eps) {
|
||||
x1 = floor (_cairo_fixed_to_double (bbox->p1.x));
|
||||
y1 = floor (surface->height - _cairo_fixed_to_double (bbox->p2.y));
|
||||
x2 = ceil (_cairo_fixed_to_double (bbox->p2.x));
|
||||
y2 = ceil (surface->height - _cairo_fixed_to_double (bbox->p1.y));
|
||||
} else {
|
||||
x1 = 0;
|
||||
y1 = 0;
|
||||
x2 = ceil (surface->width);
|
||||
y2 = ceil (surface->height);
|
||||
}
|
||||
x1 = floor (_cairo_fixed_to_double (bbox->p1.x));
|
||||
y1 = floor (surface->height - _cairo_fixed_to_double (bbox->p2.y));
|
||||
x2 = ceil (_cairo_fixed_to_double (bbox->p2.x));
|
||||
y2 = ceil (surface->height - _cairo_fixed_to_double (bbox->p1.y));
|
||||
|
||||
surface->page_bbox.x = x1;
|
||||
surface->page_bbox.y = y1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue