[goocanvas] 2010-05-10 Damon Chaplin <damon gnome org>



commit 86e23ef0e98a4d598c3f3180fa13f9d64aeaa409
Author: Damon Chaplin <damon gnome org>
Date:   Mon May 10 10:01:28 2010 +0100

    2010-05-10  Damon Chaplin  <damon gnome org>
    
            * src/goocanvaspolyline.c: don't use the reconfigure_arrows flag
            any more - always reconfigure the arrows during an update. This
            avoids a bug where the line width changes but the arrows don't get
            reconfigured, since the line width is an inherited property and
            reconfigure_arrows wasn't being set when it changed.

 ChangeLog               |    8 ++++++++
 src/goocanvaspolyline.c |   15 +--------------
 src/goocanvaspolyline.h |    2 +-
 3 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c5feb46..8623f21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-10  Damon Chaplin  <damon gnome org>
+
+	* src/goocanvaspolyline.c: don't use the reconfigure_arrows flag
+	any more - always reconfigure the arrows during an update. This
+	avoids a bug where the line width changes but the arrows don't get
+	reconfigured, since the line width is an inherited property and
+	reconfigure_arrows wasn't being set when it changed.
+
 2010-05-07  Damon Chaplin  <damon gnome org>
 
 	* src/goocanvasstyle.c (goo_canvas_style_set_stroke_options): handle
diff --git a/src/goocanvaspolyline.c b/src/goocanvaspolyline.c
index 94fc8c4..d6c98fd 100644
--- a/src/goocanvaspolyline.c
+++ b/src/goocanvaspolyline.c
@@ -459,11 +459,6 @@ goo_canvas_polyline_reconfigure_arrows (GooCanvasPolyline *polyline)
   GooCanvasPolylineData *polyline_data = polyline->polyline_data;
   double line_width;
 
-  if (!polyline_data->reconfigure_arrows)
-    return;
-
-  polyline_data->reconfigure_arrows = FALSE;
-
   if (polyline_data->num_points < 2
       || (!polyline_data->start_arrow && !polyline_data->end_arrow))
     return;
@@ -532,7 +527,6 @@ goo_canvas_polyline_set_common_property (GObject              *object,
 	  memcpy (polyline_data->coords, points->coords,
 		  polyline_data->num_points * 2 * sizeof (double));
 	}
-      polyline_data->reconfigure_arrows = TRUE;
       g_object_notify (object, "x");
       g_object_notify (object, "y");
       g_object_notify (object, "width");
@@ -540,30 +534,24 @@ goo_canvas_polyline_set_common_property (GObject              *object,
       break;
     case PROP_CLOSE_PATH:
       polyline_data->close_path = g_value_get_boolean (value);
-      polyline_data->reconfigure_arrows = TRUE;
       break;
     case PROP_START_ARROW:
       polyline_data->start_arrow = g_value_get_boolean (value);
-      polyline_data->reconfigure_arrows = TRUE;
       break;
     case PROP_END_ARROW:
       polyline_data->end_arrow = g_value_get_boolean (value);
-      polyline_data->reconfigure_arrows = TRUE;
       break;
     case PROP_ARROW_LENGTH:
       ensure_arrow_data (polyline_data);
       polyline_data->arrow_data->arrow_length = g_value_get_double (value);
-      polyline_data->reconfigure_arrows = TRUE;
       break;
     case PROP_ARROW_WIDTH:
       ensure_arrow_data (polyline_data);
       polyline_data->arrow_data->arrow_width = g_value_get_double (value);
-      polyline_data->reconfigure_arrows = TRUE;
       break;
     case PROP_ARROW_TIP_LENGTH:
       ensure_arrow_data (polyline_data);
       polyline_data->arrow_data->arrow_tip_length = g_value_get_double (value);
-      polyline_data->reconfigure_arrows = TRUE;
       break;
     case PROP_X:
       if (polyline_data->num_points > 0)
@@ -1009,8 +997,7 @@ goo_canvas_polyline_update  (GooCanvasItemSimple *simple,
   GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple;
   GooCanvasPolylineData *polyline_data = polyline->polyline_data;
 
-  if (polyline_data->reconfigure_arrows)
-    goo_canvas_polyline_reconfigure_arrows (polyline);
+  goo_canvas_polyline_reconfigure_arrows (polyline);
 
   /* Compute the new bounds. */
   goo_canvas_polyline_compute_bounds (polyline, cr, &simple->bounds);
diff --git a/src/goocanvaspolyline.h b/src/goocanvaspolyline.h
index cc1261a..96212bd 100644
--- a/src/goocanvaspolyline.h
+++ b/src/goocanvaspolyline.h
@@ -63,7 +63,7 @@ struct _GooCanvasPolylineData
   guint close_path	   : 1;
   guint start_arrow	   : 1;
   guint end_arrow          : 1;
-  guint reconfigure_arrows : 1;
+  guint reconfigure_arrows : 1;		/* Not used any more. */
 };
 
 



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