Code

Add code to fix bug #380501 in the future...
authorJohan Engelen <goejendaagh@zonnet.nl>
Tue, 26 Oct 2010 20:22:51 +0000 (22:22 +0200)
committerJohan Engelen <goejendaagh@zonnet.nl>
Tue, 26 Oct 2010 20:22:51 +0000 (22:22 +0200)
src/extension/internal/cairo-render-context.cpp

index 066324ebf96a2ee1145702625fdc0c81c4b99793..9cb2b8a0bdc72aba54b12628efcd13a06db72a73 100644 (file)
@@ -796,6 +796,13 @@ CairoRenderContext::setupSurface(double width, double height)
 #if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 2))
             cairo_ps_surface_restrict_to_level(surface, (cairo_ps_level_t)_ps_level);
             cairo_ps_surface_set_eps(surface, (cairo_bool_t) _eps);
+#endif
+            // Cairo calculates the bounding box itself, however we want to override this. See Launchpad bug #380501
+#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2))
+            if (override_bbox) {
+                cairo_ps_dsc_comment(surface, "%%BoundingBox: 100 100 200 200");
+                cairo_ps_dsc_comment(surface, "%%PageBoundingBox: 100 100 200 200");
+            }
 #endif
             break;
 #endif