[cairo-commit] src/cairo-ps-surface.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Sun May 22 04:14:23 PDT 2011


 src/cairo-ps-surface.c |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit 6936a2b4178803506de279de56b98a138cc6288b
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun May 22 20:41:18 2011 +0930

    PS: Use tight bounding box
    
    Now that the page size is specified by %%DocumentMedia
    we can make %%BoundingBox compliant.

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index ef53dd1..5c83453 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -3842,17 +3842,10 @@ _cairo_ps_surface_set_bounding_box (void		*abstract_surface,
     cairo_bool_t has_page_media, has_page_bbox;
     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;


More information about the cairo-commit mailing list