Code

patch by Adib for 406470
authorbuliabyak <buliabyak@users.sourceforge.net>
Sat, 5 Sep 2009 23:58:47 +0000 (23:58 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sat, 5 Sep 2009 23:58:47 +0000 (23:58 +0000)
src/extension/internal/cairo-render-context.cpp

index d1462e52e5e43ae663bd381a351c1aa84650a4e2..364dfcfa823792afde535d1ab7cc2d772faf9e28 100644 (file)
@@ -192,6 +192,8 @@ CairoRenderContext::cloneMe(double width, double height) const
                                                             (int)ceil(width), (int)ceil(height));
     new_context->_cr = cairo_create(surface);
     new_context->_surface = surface;
+    new_context->_width = width;
+    new_context->_height = height;
     new_context->_is_valid = TRUE;
 
     return new_context;
@@ -749,6 +751,9 @@ CairoRenderContext::setupSurface(double width, double height)
     if (_vector_based_target && _stream == NULL)
         return false;
 
+    _width = width;
+    _height = height;
+
     cairo_surface_t *surface = NULL;
     switch (_target) {
         case CAIRO_SURFACE_TYPE_IMAGE:
@@ -796,13 +801,16 @@ bool
 CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm)
 {
     if(surface == NULL) {
-        return FALSE;
+        return false;
     }
     if(CAIRO_STATUS_SUCCESS != cairo_surface_status(surface)) {
-        return FALSE;
+        return false;
     }
 
     _cr = cairo_create(surface);
+    if(CAIRO_STATUS_SUCCESS != cairo_status(_cr)) {
+        return false;
+    }
     if (ctm)
         cairo_set_matrix(_cr, ctm);
     _surface = surface;