[goffice] Fix sheet objects rendering, including widgets. [#744076]



commit ed932cb367c59927d5635b1d618b8db08d4048d4
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Mar 3 08:32:29 2015 +0100

    Fix sheet objects rendering, including widgets. [#744076]

 ChangeLog                   |    5 +++++
 NEWS                        |    1 +
 goffice/canvas/goc-canvas.c |    5 +++++
 3 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6d00b06..ec431b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-03  Jean Brefort  <jean brefort normalesup org>
+
+       * goffice/canvas/goc-canvas.c (goc_canvas_draw): clip each rectangle before
+       drawing. [#744076]
+
 2015-03-01  Morten Welinder  <terra gnome org>
 
        * goffice/utils/go-pixbuf.c (go_pixbuf_create_pixbuf): Avoid
diff --git a/NEWS b/NEWS
index 5d860b4..8b890de 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ goffice 0.10.21:
 Jean:
        * Ignore invalid values while checking data order. [#744200]
        * Ensure that GOPixbuf  keeps the original data around. [#745297]
+       * Fix sheet objects rendering, including widgets. [#744076]
 
 Morten:
        * Fix problem with linear solver.
diff --git a/goffice/canvas/goc-canvas.c b/goffice/canvas/goc-canvas.c
index 992fcbf..bc8cb3c 100644
--- a/goffice/canvas/goc-canvas.c
+++ b/goffice/canvas/goc-canvas.c
@@ -96,6 +96,10 @@ goc_canvas_draw (GtkWidget *widget, cairo_t *cr)
        cairo_translate (cr, -x, -y);
        goc_item_get_bounds (GOC_ITEM (canvas->root),&x0, &y0, &x1, &y1);
        for (i= 0; i  < l->num_rectangles; i++) {
+               cairo_save (cr);
+               cairo_rectangle (cr, l->rectangles[i].x, l->rectangles[i].y,
+                                l->rectangles[i].width, l->rectangles[i].height);
+               cairo_clip (cr);
                clip_x1 = l->rectangles[i].x;
                clip_y1 = l->rectangles[i].y;
                clip_x2 = clip_x1 + l->rectangles[i].width;
@@ -114,6 +118,7 @@ goc_canvas_draw (GtkWidget *widget, cairo_t *cr)
                        canvas->cur_event = (GdkEvent *) event;
                        goc_item_draw_region (GOC_ITEM (canvas->root), cr, ax0, ay0, ax1, ay1);
                }
+               cairo_restore (cr);
        }
        cairo_rectangle_list_destroy (l);
        return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]