|
From: <ma...@us...> - 2011-01-23 21:17:43
|
Revision: 271
http://openautomation.svn.sourceforge.net/openautomation/?rev=271&view=rev
Author: mayerch
Date: 2011-01-23 21:17:35 +0000 (Sun, 23 Jan 2011)
Log Message:
-----------
clean up
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/gle/gle.block.js
PyWireGate/trunk/logic_editor/gle/gle.connection.js
Modified: PyWireGate/trunk/logic_editor/gle/gle.block.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-23 20:19:55 UTC (rev 270)
+++ PyWireGate/trunk/logic_editor/gle/gle.block.js 2011-01-23 21:17:35 UTC (rev 271)
@@ -376,7 +376,6 @@
that.setConnection( pt, pn,c );
///???
var parameter = {con:c};
- console.log('editorConnectionPointDrag', [op.x, op.y]);
$(document).bind( 'mousemove', parameter, editorConnectionPointMouseMove );
$(document).bind( 'mouseup' , parameter, editorConnectionPointMouseUp );
Modified: PyWireGate/trunk/logic_editor/gle/gle.connection.js
===================================================================
--- PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-23 20:19:55 UTC (rev 270)
+++ PyWireGate/trunk/logic_editor/gle/gle.connection.js 2011-01-23 21:17:35 UTC (rev 271)
@@ -33,8 +33,10 @@
var outset = 3; // how far should the handle stick out
// setup the private variables
- var origin = JSON.origin || undefined;
+ var origin = JSON.origin;
+ var originPortNumber = JSON.originPortNumber;
var paths = JSON.paths || [];
+ JSON = 0; // not needed anymore - get it out of the closure
var branch = 0; // the current branch to edit
var lastFixed = 0; // the last fixed position
@@ -173,9 +175,14 @@
{
// FIXME: convert doring the transition period
if( ! 'x' in pos ) pos = { x: pos[0], y: pos[1] };
- if( i < 0 ) i = paths[ branch ].path.length - 1;
- var isLast = (i == paths[ branch ].path.length - 1);
+ var path = paths[ branch ].path;
+ var orig_pos = origin.outPortPos( originPortNumber );
+ var i = parseInt( i ); // force cast
+
+ if( i < 0 ) i = path.length - 1;
+ //var isLast = (i == paths[ branch ].path.length - 1);
+
if( freely )
{
paths[ branch ].path[ i ] = [ pos.x, pos.y ];
@@ -183,8 +190,6 @@
return;
}
- var path = paths[ branch ].path; // recycle
- var i = parseInt( i ); // force cast
if( extend )
{
if( lastPoint === undefined ) lastPoint = [ path[ i ][0], path[ i ][1] ];
@@ -280,7 +285,7 @@
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 &&
+ 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 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|