[goffice] Clip grid lines rendering to the plot area. [#50]



commit 60b6581a8f2e327097a65b906dc5e0a647155d81
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Jun 2 11:31:20 2020 +0200

    Clip grid lines rendering to the plot area. [#50]

 ChangeLog                     | 5 +++++
 NEWS                          | 1 +
 goffice/graph/gog-grid-line.c | 5 +++++
 3 files changed, 11 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index c0386363..1f3c40aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-02  Jean Brefort  <jean brefort normalesup org>
+
+       * goffice/graph/gog-grid-line.c (gog_grid_line_xy_render): clip grid lines
+       rendering to the plot area. [#50]
+
 2020-06-01  Jean Brefort  <jean brefort normalesup org>
 
        * goffice/canvas/goc-canvas.c (size_changed_cb): revert previous change.
diff --git a/NEWS b/NEWS
index 1812d90f..6c38206c 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Jean:
        * Clip data labels in XY plots. [#47]
        * Don't emit a critical for invalid series in Logarithmic fit. [#49]
        * Optimize GtkWidget embedding in the canvas. See #465.
+       * Clip grid lines rendering to the plot area. [#50]
 
 --------------------------------------------------------------------------
 goffice 0.10.47:
diff --git a/goffice/graph/gog-grid-line.c b/goffice/graph/gog-grid-line.c
index b87b07f0..e5424ab0 100644
--- a/goffice/graph/gog-grid-line.c
+++ b/goffice/graph/gog-grid-line.c
@@ -141,6 +141,10 @@ gog_grid_line_xy_render (GogGridLine *grid_line, GogView *view,
        unsigned int i;
        gboolean stripe_started = FALSE;
 
+       gog_renderer_push_clip_rectangle (view->renderer,
+                                         plot_area->x, plot_area->y,
+                                         plot_area->w, plot_area->h);
+
        switch (axis_type) {
                case GOG_AXIS_X:
                        map = gog_axis_map_new (axis, plot_area->x, plot_area->w);
@@ -223,6 +227,7 @@ gog_grid_line_xy_render (GogGridLine *grid_line, GogView *view,
                        return;
        }
 
+       gog_renderer_pop_clip (view->renderer);
        go_path_free (path);
        gog_axis_map_free (map);
 }


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