[gtk] node-editor: Never scale nodes up



commit 9117ee83ebf3ba2ff07f4fa4fcecb41060425ec4
Author: Benjamin Otte <otte redhat com>
Date:   Wed May 8 17:17:51 2019 +0200

    node-editor: Never scale nodes up
    
    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 | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/demos/node-editor/node-editor-window.c b/demos/node-editor/node-editor-window.c
index cb9f78c349..0c460e6082 100644
--- a/demos/node-editor/node-editor-window.c
+++ b/demos/node-editor/node-editor-window.c
@@ -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 ();


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