[gegl] gegl: add gegl_path_dirty for forcing redraws



commit 673b78c9fbc491cb21d394dbc848039160afc8cd
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Feb 16 14:42:31 2019 +0100

    gegl: add gegl_path_dirty for forcing redraws
    
    When modifying an inline GeglPathPoint, the path doesn't change this
    adds the ability to trigger such renders.

 gegl/property-types/gegl-path.c | 15 ++++++++++-----
 gegl/property-types/gegl-path.h | 12 ++++++++++++
 2 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/gegl/property-types/gegl-path.c b/gegl/property-types/gegl-path.c
index c5393d1e6..9fe4edc64 100644
--- a/gegl/property-types/gegl-path.c
+++ b/gegl/property-types/gegl-path.c
@@ -785,6 +785,15 @@ gegl_path_remove_node (GeglPath *vector,
   gegl_path_emit_changed (vector, NULL);
 }
 
+void
+gegl_path_dirty (GeglPath *path)
+{
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
+  priv->flat_path_clean = FALSE;
+  priv->length_clean = FALSE;
+  gegl_path_emit_changed (path, NULL);
+}
+
 void
 gegl_path_parse_string (GeglPath    *vector,
                         const gchar *path)
@@ -846,11 +855,7 @@ gegl_path_parse_string (GeglPath    *vector,
         p++;
     }
 
-  priv->flat_path_clean = FALSE;
-  priv->length_clean = FALSE;
-  {
-   gegl_path_emit_changed (vector, NULL);
-  }
+  gegl_path_dirty (vector);
 }
 
 void
diff --git a/gegl/property-types/gegl-path.h b/gegl/property-types/gegl-path.h
index fa8d55b9a..5cc3be362 100644
--- a/gegl/property-types/gegl-path.h
+++ b/gegl/property-types/gegl-path.h
@@ -523,6 +523,18 @@ void           gegl_path_point_lerp    (GeglPathPoint *dest,
 gdouble        gegl_path_point_dist    (GeglPathPoint *a,
                                         GeglPathPoint *b);
 
+
+/**
+ * gegl_path_dirty:
+ * @path: a #GeglPath
+ *
+ * Marks the path as dirty and issues an invalidation for the path rendering,
+ * use this if modifying the values of a GeglPathPoint inline.
+ */
+void
+gegl_path_dirty (GeglPath *path);
+
+
 G_END_DECLS
 
 #endif /* __GEGL_PATH_H__ */


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