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 2011 - http://abeall.com // Version 1.1 var dom = fw.getDocumentDOM(); // document object var sel = new Array().concat(fw.selection); // saved selection function MirrorSelectedPoints(direction) { if(!sel)return false; var selPoints = []; // find all selected points for(var s = 0; s < sel.length; s++){ for(var c = 0; c < sel[s].contours.length; c++){ var con = sel[s].contours[c]; var nlen = con.nodes.length; for(var n = 0; n < nlen; n++){ if(con.nodes[n].isSelectedPoint || fw.activeTool!='Subselection') selPoints.push(con.nodes[n]); } } } if(!selPoints.length) return false; // choose direction if(direction == undefined) direction = fw.yesNoDialog('Choose direction:\n[Yes] Mirror Horizontal\n[No] Mirror Vertical'); // single point selected, mirror handles if(selPoints.length == 1){ var p = selPoints[0]; if(direction){ //horizontal p.predX -= (p.predX-p.x) * 2; p.succX -= (p.succX-p.x) * 2; }else{ //vertical p.predY -= (p.predY-p.y) * 2; p.succY -= (p.succY-p.y) * 2; } return; } // multiple points selected, mirror handles and point position, based on selected point positions bounding box var bounds = {left:100000, top:100000, right:-100000, bottom:-100000}; var nlen = selPoints.length; for(var i = 0; i < nlen; i++){ var p = selPoints[i]; bounds.left = Math.min(bounds.left, p.x); bounds.top = Math.min(bounds.top, p.y); bounds.right = Math.max(bounds.right, p.x); bounds.bottom = Math.max(bounds.bottom, p.y); } // alert(bounds.left+','+bounds.top+','+bounds.right+','+bounds.bottom); var p, ratio, distance; if(direction){ //horizontal var nlen = selPoints.length; for(var i = 0; i < nlen; i++){ p = selPoints[i]; distance = bounds.right-bounds.left; ratio = 1 - ((p.x - bounds.left) / distance); p.x = bounds.left + (distance * ratio); ratio = 1 - ((p.succX - bounds.left) / distance); p.succX = bounds.left + (distance * ratio); ratio = 1 - ((p.predX - bounds.left) / distance); p.predX = bounds.left + (distance * ratio); } }else{ //vertical var nlen = selPoints.length; for(var i = 0; i < nlen; i++){ p = selPoints[i]; distance = bounds.bottom - bounds.top; ratio = 1 - ((p.y - bounds.top) / distance); p.y = bounds.top + (distance * ratio); ratio = 1 - ((p.succY - bounds.top) / distance); p.succY = bounds.top + (distance * ratio); ratio = 1 - ((p.predY - bounds.top) / distance); p.predY = bounds.top + (distance * ratio); } } return true; } //try{ MirrorSelectedPoints(); //}catch(e){alert([e.lineNumber, e])}