[gegl-gtk/soc-2011-warp] warp example: fix a bug that made appear wrong deformation between strokes



commit 882699e113a610361e7f6a5964ef49b770bae27f
Author: Michael Murà <batolettre gmail com>
Date:   Thu Jul 28 14:41:07 2011 +0200

    warp example: fix a bug that made appear wrong deformation between strokes

 examples/warp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/examples/warp.c b/examples/warp.c
index c0f35b2..6d99289 100644
--- a/examples/warp.c
+++ b/examples/warp.c
@@ -85,10 +85,16 @@ add_op ()
 static gboolean paint_press (GtkWidget      *widget,
                              GdkEventButton *event)
 {
+  if (current_stroke)
+    g_object_unref (current_stroke);
+
   current_stroke = gegl_path_new ();
   gegl_path_append (current_stroke,
                     'M', event->x, event->y);
 
+  cursor_x = event->x;
+  cursor_y = event->y;
+
   add_op ();
 
   stroke_timer = g_timeout_add (STROKE_PERIOD, add_event_timer, NULL);



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