[gegl] bin: add custom ui for gegl-vector stroke



commit 4071fc5c0c721f7f57791a20e6f095a1fcc96c38
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Feb 16 14:43:26 2019 +0100

    bin: add custom ui for gegl-vector stroke
    
    This adds a basic editing capability for moving points of a poly-line,
    GObject introspection via lua should be sufficient for various forms of
    full bezier editing.

 bin/lua/gegl_vector-stroke.lua | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
---
diff --git a/bin/lua/gegl_vector-stroke.lua b/bin/lua/gegl_vector-stroke.lua
new file mode 100644
index 000000000..44842797a
--- /dev/null
+++ b/bin/lua/gegl_vector-stroke.lua
@@ -0,0 +1,26 @@
+local path = active:get_property("d").value
+
+path:foreach( function(el)
+  local x = el.point[1].x
+  local y = el.point[1].y
+
+  cr:new_path()
+  cr:arc(x, y, dim/15, 0, 3.1415 * 2)
+
+mrg:listen(Mrg.DRAG, function(ev)
+  if ev.type == Mrg.DRAG_MOTION then
+    local x = el.point[1].x
+    local y = el.point[1].y
+    x = x + ev.delta_x
+    y = y + ev.delta_y
+    el.point[1].x = x
+    el.point[1].y = y
+    path:dirty()
+    ev:stop_propagate();
+  end
+end)
+
+  cr:set_source_rgb(0,1,0)
+  cr:fill()
+
+end)


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