[goffice] Clip histograms to the plot area. [#684195]



commit 7199471027095f40d77772f326d430be76e51461
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Sep 20 11:11:22 2012 +0200

    Clip histograms to the plot area. [#684195]

 ChangeLog                            |    5 +++++
 NEWS                                 |    1 +
 plugins/plot_distrib/gog-histogram.c |    5 +++++
 3 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9677d16..0d83ec3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-20  Jean Brefort  <jean brefort normalesup org>
+
+	* plugins/plot_distrib/gog-histogram.c
+	(gog_histogram_plot_view_render): clip drawing to the plot area. [#684195]
+
 2012-09-15  Jean Brefort  <jean brefort normalesup org>
 
 	* plugins/plot_distrib/gog-histogram.c
diff --git a/NEWS b/NEWS
index ef563fd..db55bf2 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Andreas:
 Jean:
 	* New scattered min-max plot type. [#683493]
 	* Don't crash when no valid data is available for histograms. [#684047]
+	* Clip histograms to the plot area. [#684195]
 
 --------------------------------------------------------------------------
 goffice 0.9.6:
diff --git a/plugins/plot_distrib/gog-histogram.c b/plugins/plot_distrib/gog-histogram.c
index 987e67c..522b024 100644
--- a/plugins/plot_distrib/gog-histogram.c
+++ b/plugins/plot_distrib/gog-histogram.c
@@ -563,6 +563,9 @@ gog_histogram_plot_view_render (GogView *view, GogViewAllocation const *bbox)
 		return;
 	}
 
+	/* clip the plot to it's allocated rectangle, see #684195 */
+	gog_renderer_push_clip_rectangle (view->renderer, area->x, area->y, area->w, area->h);
+
 	x_map = gog_chart_map_get_axis_map (chart_map, 0);
 	y_map = gog_chart_map_get_axis_map (chart_map, 1);
 
@@ -796,6 +799,8 @@ gog_histogram_plot_view_render (GogView *view, GogViewAllocation const *bbox)
 		}
 		gog_renderer_pop_style (view->renderer);
 	}
+	gog_renderer_pop_clip (view->renderer);
+
 	/* Now render children */
 	for (ptr = view->children ; ptr != NULL ; ptr = ptr->next)
 		gog_view_render	(ptr->data, bbox);



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