[goffice] Don't draw a marker in the legend when not needed. [#685484]



commit b6e53c55c0f42d01d4267820c91752af56b1a384
Author: Jean Brefort <jean brefort normalesup org>
Date:   Fri Oct 5 11:32:54 2012 +0200

    Don't draw a marker in the legend when not needed. [#685484]

 ChangeLog                  |    5 +++++
 NEWS                       |    2 ++
 goffice/graph/gog-legend.c |   10 ++++++----
 3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a789afe..d66167e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-05  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/graph/gog-legend.c (cb_render_elements): don't draw a marker
+	when not needed. [#685484]
+
 2012-10-04  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/graph/gog-axis.c (gog_axis_populate_editor): don't show the
diff --git a/NEWS b/NEWS
index aa92212..c533309 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,8 @@ Jean:
 	* Fix backplane position when data are nearly all the same. [#684599]
 	* Fixed crash when using data labels after gtk+ behavior change. [#684889]
 	* Accept an offset up to 20 for graph data labels. [#684892]
+	* Removed span tab 3D axes that don't support it. [#685405]
+	* Don't draw a marker in the legend when not needed. [#685484]
 
 --------------------------------------------------------------------------
 goffice 0.9.6:
diff --git a/goffice/graph/gog-legend.c b/goffice/graph/gog-legend.c
index 5850f0a..fbf1283 100644
--- a/goffice/graph/gog-legend.c
+++ b/goffice/graph/gog-legend.c
@@ -464,9 +464,6 @@ cb_render_elements (unsigned index, GOStyle const *base_style, char const *name,
 	if (base_style->interesting_fields & GO_STYLE_LINE) { /* line and marker */
 		style = go_style_dup (base_style);
 		g_return_if_fail (style != NULL);
-		go_marker_set_size (style->marker.mark,
-				    go_marker_get_size (style->marker.mark) *
-				    data->swatch_scale_a + data->swatch_scale_b);
 		if (style->line.width > data->hairline_width)
 			style->line.width = style->line.width * data->line_scale_a + data->line_scale_b;
 
@@ -485,7 +482,12 @@ cb_render_elements (unsigned index, GOStyle const *base_style, char const *name,
 		}
 		gog_renderer_stroke_serie (renderer, line_path);
 		go_path_free (line_path);
-		gog_renderer_draw_marker (renderer, data->x + data->swatch.w  * GLV_LINE_LENGTH_EM * 0.5, y);
+		if (base_style->interesting_fields & GO_STYLE_MARKER) {
+			go_marker_set_size (style->marker.mark,
+						go_marker_get_size (style->marker.mark) *
+						data->swatch_scale_a + data->swatch_scale_b);
+			gog_renderer_draw_marker (renderer, data->x + data->swatch.w  * GLV_LINE_LENGTH_EM * 0.5, y);
+		}
 	} else if (base_style->interesting_fields & GO_STYLE_FILL) {					/* area swatch */
 		style = go_style_dup (base_style);
 		if (style->line.width > data->hairline_width)



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