[gegl/soc-2012-editor: 35/36] Attempts to allow previews of infinite operations (still not operational)



commit aecc17ca01f2b67b49f477b87e252bcf21a4180e
Author: Isaac Wagner <isaacbw src gnome org>
Date:   Thu Jul 5 17:20:01 2012 -0400

    Attempts to allow previews of infinite operations (still not operational)

 bin/editor/BUGS                |    1 +
 bin/editor/gegl-editor-layer.c |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/bin/editor/BUGS b/bin/editor/BUGS
new file mode 100644
index 0000000..b99e3bd
--- /dev/null
+++ b/bin/editor/BUGS
@@ -0,0 +1 @@
+Nodes containing operations with infinite bounding boxes cannot be rendered
\ No newline at end of file
diff --git a/bin/editor/gegl-editor-layer.c b/bin/editor/gegl-editor-layer.c
index 75bc39e..1c56d22 100644
--- a/bin/editor/gegl-editor-layer.c
+++ b/bin/editor/gegl-editor-layer.c
@@ -286,8 +286,20 @@ gint layer_node_selected (gpointer host, GeglEditor* editor, gint node_id)
     }
 
   //  gegl_node_process(node);
-  GtkWidget *gtk_view = gegl_gtk_view_new_for_node(node);
+  GtkWidget *gtk_view = gegl_gtk_view_new_for_node(node);;
+
+  GeglRectangle rect = gegl_node_get_bounding_box(node);
+
+  if(gegl_rectangle_is_infinite_plane(&rect))
+    {
+      gegl_gtk_view_set_autoscale_policy(gtk_view, GEGL_GTK_VIEW_AUTOSCALE_DISABLED);
+      gegl_gtk_view_set_scale(gtk_view, 1.f);
+      g_print("Disable autoscale: scale=%f, x=%f, y=%f\n", gegl_gtk_view_get_scale(gtk_view), 
+      gegl_gtk_view_get_x(gtk_view), gegl_gtk_view_get_y(gtk_view));
+    }
+
   gtk_widget_show(gtk_view);
+
   //TODO: draw checkerboard under preview to indicate transparency
 
   gtk_box_pack_start(GTK_BOX(self->prop_box), prop_table, FALSE, TRUE, 0);



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