|
From: <ma...@us...> - 2011-01-22 14:09:28
|
Revision: 263
http://openautomation.svn.sourceforge.net/openautomation/?rev=263&view=rev
Author: mayerch
Date: 2011-01-22 14:09:22 +0000 (Sat, 22 Jan 2011)
Log Message:
-----------
Startet functionality to simplify connection during handle move
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/gle/gle.connection.js
Modified: PyWireGate/trunk/logic_editor/gle/gle.connection.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-22 13:30:12 UTC (rev 262)
+++ PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-22 14:09:22 UTC (rev 263)
@@ -160,6 +160,17 @@
}
path[i][0] = pos.x;
path[i][1] = pos.y;
+ // simplify path, i.e. delete double points
+ for( var j = path.length-1; j > 0; j-- )
+ {
+ if( i == j || i == j-1 ) continue; // don't delete current point
+ if( Math.abs( path[j-1][0] - path[j][0] ) < 1.0 &&
+ Math.abs( path[j-1][1] - path[j][1] ) < 1.0 )
+ {
+ path.splice( j-1, 2 );
+ if( j < i ) ed.obj[2] -= 2;
+ }
+ }
draw();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|