[gegl] bin: stop cursor navigation towards sources on clones



commit a569b4d1fa35b2d25e231f25cbfe4391e05f2c90
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Jan 19 02:07:12 2019 +0100

    bin: stop cursor navigation towards sources on clones

 bin/ui.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/bin/ui.c b/bin/ui.c
index 9a11d3b0a..609cd64bb 100644
--- a/bin/ui.c
+++ b/bin/ui.c
@@ -84,6 +84,17 @@ static GeglNode *gegl_node_get_ui_consumer (GeglNode    *node,
                                             const char  *output_pad,
                                             const char **consumer_pad);
 
+static GeglNode *gegl_node_get_ui_producer (GeglNode    *node,
+                                            const char  *input_pad,
+                                            char **output_pad)
+{
+  GeglNode *producer = gegl_node_get_producer (node, input_pad, output_pad);
+  if (producer && node == gegl_node_get_ui_consumer (producer, "output", NULL))
+    return producer;
+  return NULL;
+}
+
+
 static GeglNode *gegl_node_get_consumer_no (GeglNode *node,
                                             const char *output_pad,
                                             const char **consumer_pad,
@@ -1964,7 +1975,7 @@ int cmd_activate (COMMAND_ARGS) /* "activate", 1, "<input|output|aux|append|sour
 
   if (!strcmp (argv[1], "input"))
   {
-    ref = gegl_node_get_producer (o->active, "input", NULL);
+    ref = gegl_node_get_ui_producer (o->active, "input", NULL);
     if (ref == NULL)
       o->pad_active = 0;
     else
@@ -2205,7 +2216,7 @@ draw_node (State *o, int indent, int line_no, GeglNode *node, gboolean active)
   char *opname = NULL;
   GList *to_remove = NULL;
   Mrg *mrg = o->mrg;
-  float em;
+  //float em;
   float x = compute_node_x (mrg, indent, line_no);
   float y = compute_node_y (mrg, indent, line_no);
 
@@ -2233,7 +2244,7 @@ draw_node (State *o, int indent, int line_no, GeglNode *node, gboolean active)
     sprintf (style, "color:%s;left:%f;top:%f;%s", active?"yellow":"white", x, y, 
active?"":"border-color:#ccc;");
     mrg_start_with_style (mrg, "div.node", NULL, style);
   }
-  em = mrg_em (mrg);
+  //em = mrg_em (mrg);
 
 //  if (!active)
 //  {


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