Strict Standards: Only variables should be passed by reference in /home/abeall/public_html/fireworks/download.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/abeall/public_html/fireworks/download.php:28) in /home/abeall/public_html/fireworks/download.php on line 44
// Fireworks JavaScript Command // Install by copying to Fireworks/Configuration/Commands/ // Aaron Beall 2008-2011 - http://abeall.com // Version 1.1.2 /* - [CHANGED-v1.1] copyObject/pasteObject to copyNode/pasteNode */ var dom = fw.getDocumentDOM(); var sel = [].concat(fw.selection); function JoinPoints(){ // require active document if (!dom) return false; // validate selection var nod, p1, p2; for(var s in sel){ if(sel[s] == '[object Path]'){ for(var c = 0; c < sel[s].contours.length; c++){ var nlen = sel[s].contours[c].nodes.length; for(var n = 0; n < nlen; n++){ nod = sel[s].contours[c].nodes[n]; if(nod.isSelectedPoint){ if(!p1){ if(n == 0 || n == sel[s].contours[c].nodes.length - 1) p1 = {s:s,c:c,n:n,x:nod.x,y:nod.y}; }else if(!p2){ if(n == 0 || n == sel[s].contours[c].nodes.length - 1) p2 = {s:s,c:c,n:n,x:nod.x,y:nod.y}; }else{ return alert('To join, you must select only two endpoints.'); } } } } } } if(!p1 || !p2) return alert('To join, you must select two open endpoints.'); // join points var cont1 = sel[p1.s].contours[p1.c], cont2 = sel[p2.s].contours[p2.c]; if(p1.s == p2.s && p1.c == p2.c){ // same path, same contour // close path sel[p1.s].contours[p1.c].isClosed = true; // straigten endpoints cont1.nodes[p1.n][p1.n==0 ? 'predX' : 'succX'] = p1.x; cont1.nodes[p1.n][p1.n==0 ? 'predY' : 'succY'] = p1.y; cont2.nodes[p2.n][p2.n==0 ? 'predX' : 'succX'] = p2.x; cont2.nodes[p2.n][p2.n==0 ? 'predY' : 'succY'] = p2.y; }else if(p1.s == p2.s && p1.c != p2.c){ // same path, different contour // merge contours into one contour, in correct node order var newNodes = []; if(p1.n == 0){ if(p2.n == 0){ //alert('p1 start, p2 start'); for(var n = cont2.nodes.length-1; n>=0; n--){ newNodes.push(copyNode(cont2.nodes[n])); flipHandles(newNodes[newNodes.length-1]); } }else{ //alert('p1 start, p2 end'); for(var n = 0; n=0; n--){ newNodes.push(copyNode(cont2.nodes[n])); flipHandles(newNodes[newNodes.length-1]); } }else{ //alert('p1 end, p2 end'); for(var n = 0; n=0; n--){ newNodes.push(copyNode(cont1.nodes[n])); flipHandles(newNodes[newNodes.length-1]); } } // apply merged contour to contour 1 var isClosed = cont1.isClosed; sel[p1.s].contours[p1.c] = new Contour(); sel[p1.s].contours[p1.c].isClosed = isClosed; for(var n=0; n