[goffice] Really implement "scale-line-width" property.



commit 9786c8a6c076834db5912cfb43a6528ecea91063
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Mar 9 17:42:29 2010 +0100

    Really implement "scale-line-width" property.

 ChangeLog                        |    7 +++++++
 goffice/canvas/goc-item.c        |    1 +
 goffice/canvas/goc-styled-item.c |   11 +++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 68ef4a9..2922104 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-09  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/canvas/goc-item.c (goc_item_new): invalidate the new item.
+	* goffice/canvas/goc-styled-item.c (goc_styled_item_set_property),
+	(goc_styled_item_get_property), (goc_styled_item_class_init): really
+	implement the "scale-line-width" property.
+
 2010-03-09  Valek Filippov  <frob gnome org>
 
 	* goffice/canvas/goc-rectangle.c (goc_rectangle_prepare_draw): enhance
diff --git a/goffice/canvas/goc-item.c b/goffice/canvas/goc-item.c
index 18e2f81..87beb32 100644
--- a/goffice/canvas/goc-item.c
+++ b/goffice/canvas/goc-item.c
@@ -305,6 +305,7 @@ goc_item_new (GocGroup *parent, GType type, const gchar *first_arg_name, ...)
 	g_return_val_if_fail ((item != NULL), NULL);
 
 	goc_group_add_child (parent, item);
+	goc_item_invalidate (item);
 
 	return item;
 }
diff --git a/goffice/canvas/goc-styled-item.c b/goffice/canvas/goc-styled-item.c
index 4aeb4ca..9b155ae 100644
--- a/goffice/canvas/goc-styled-item.c
+++ b/goffice/canvas/goc-styled-item.c
@@ -41,7 +41,7 @@
 enum {
 	STYLED_ITEM_PROP_0,
 	STYLED_ITEM_PROP_STYLE,
-	STYLED_ITEM_SCALE_LINE_WIDTH
+	STYLED_ITEM_PROP_SCALE_LINE_WIDTH
 };
 
 enum {
@@ -69,6 +69,10 @@ goc_styled_item_set_property (GObject *obj, guint param_id,
 	      			g_value_get_object (value));
 		break;
 
+	case STYLED_ITEM_PROP_SCALE_LINE_WIDTH :
+		gsi->scale_line_width =  g_value_get_boolean (value);
+		break;
+
 	default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
 		 return; /* NOTE : RETURN */
 	}
@@ -88,6 +92,9 @@ goc_styled_item_get_property (GObject *obj, guint param_id,
 		g_value_set_object (value, gsi->style);
 		break;
 
+	case STYLED_ITEM_PROP_SCALE_LINE_WIDTH :
+		g_value_set_boolean (value, gsi->scale_line_width);
+
 	default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
 		 break;
 	}
@@ -155,7 +162,7 @@ goc_styled_item_class_init (GocItemClass *goc_klass)
 			_("A pointer to the GOStyle object"),
 			go_style_get_type (),
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
-	g_object_class_install_property (gobject_klass, STYLED_ITEM_SCALE_LINE_WIDTH,
+	g_object_class_install_property (gobject_klass, STYLED_ITEM_PROP_SCALE_LINE_WIDTH,
 		g_param_spec_boolean ("scale-line-width",
 			_("Scale line width"),
 			_("Whether to scale the line width when zooming"),



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