node-editor: Never scale nodes up
authorBenjamin Otte <otte@redhat.com>
Wed, 8 May 2019 15:17:51 +0000 (17:17 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 8 May 2019 17:47:40 +0000 (19:47 +0200)
Scaling down is fine so one can see the nodes, but scaling up just
makes the nodes wrong for no reason at all.

demos/node-editor/node-editor-window.c

index cb9f78c349da64f00b11525e52ed4252caa138be..0c460e608276c2eb3b9aa7ee659a2d5fd43c7ed3 100644 (file)
@@ -620,6 +620,9 @@ node_editor_window_create_renderer_widget (gpointer item,
   gtk_container_add (GTK_CONTAINER (box), label);
 
   picture = gtk_picture_new_for_paintable (paintable);
+  /* don't ever scale up, we want to be as accurate as possible */
+  gtk_widget_set_halign (picture, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (picture, GTK_ALIGN_CENTER);
   gtk_container_add (GTK_CONTAINER (box), picture);
 
   row = gtk_list_box_row_new ();