From bd9cdbe898400bb99d2b47b17e27971d8035df08 Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Sun, 6 Nov 2011 19:28:24 -0500 Subject: [PATCH] streamlined "move selected" call to only be invoked when either delta x or y are != 0 --- src/g_editor.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/g_editor.c b/src/g_editor.c index 8daf7f823..4d6bd49b2 100644 --- a/src/g_editor.c +++ b/src/g_editor.c @@ -2735,12 +2735,14 @@ static void canvas_displaceselection(t_canvas *x, int dx, int dy) if (cl == vinlet_class) resortin = 1; else if (cl == voutlet_class) resortout = 1; } - sys_vgui(".x%lx.c move selected %d %d\n", x, dx, dy); - if (resortin) canvas_resortinlets(x); - if (resortout) canvas_resortoutlets(x); - //sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", x); - if (x->gl_editor->e_selection) - canvas_dirty(x, 1); + if (dx || dy) { + sys_vgui(".x%lx.c move selected %d %d\n", x, dx, dy); + if (resortin) canvas_resortinlets(x); + if (resortout) canvas_resortoutlets(x); + //sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", x); + if (x->gl_editor->e_selection) + canvas_dirty(x, 1); + } } /* this routine is called whenever a key is pressed or released. "x" -- GitLab