1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Tweak curves for overlapping nodes

This commit is contained in:
Nicholas O'Leary 2013-10-01 11:38:46 +01:00
parent 68e7e5e226
commit df205aab58

View File

@ -160,9 +160,9 @@ RED.view = function() {
scale = 0.75-0.75*((node_width-delta)/node_width); scale = 0.75-0.75*((node_width-delta)/node_width);
} }
if (dx*sc < 0) { if (dx*sc < 0) {
scale += 3*(Math.min(5*node_width,Math.abs(dx))/(5*node_width)); scale += 2*(Math.min(5*node_width,Math.abs(dx))/(5*node_width));
if (Math.abs(dy) < 4*node_height) { if (Math.abs(dy) < 3*node_height) {
scaleY = ((dy>0)?3:-3)*(((4*node_height)-Math.abs(dy))/(4*node_height))*(Math.min(node_width,Math.abs(dx))/(node_width)) ; scaleY = ((dy>0)?0.5:-0.5)*(((3*node_height)-Math.abs(dy))/(3*node_height))*(Math.min(node_width,Math.abs(dx))/(node_width)) ;
} }
} }
@ -810,9 +810,9 @@ RED.view = function() {
} }
if (dx < 0) { if (dx < 0) {
scale += 3*(Math.min(5*node_width,Math.abs(dx))/(5*node_width)); scale += 2*(Math.min(5*node_width,Math.abs(dx))/(5*node_width));
if (Math.abs(dy) < 4*node_height) { if (Math.abs(dy) < 3*node_height) {
scaleY = ((dy>0)?3:-3)*(((4*node_height)-Math.abs(dy))/(4*node_height))*(Math.min(node_width,Math.abs(dx))/(node_width)) ; scaleY = ((dy>0)?0.5:-0.5)*(((3*node_height)-Math.abs(dy))/(3*node_height))*(Math.min(node_width,Math.abs(dx))/(node_width)) ;
} }
} }