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
var dom = fw.getDocumentDOM(); var sel = [].concat(fw.selection); function LoopCanvas(){ if(!dom) return; var BOUNDS = {left:dom.left,top:dom.top,right:dom.left+dom.width,bottom:dom.top+dom.height}; var elems = [].concat(sel); // loop all objects in document if none are selected if(!sel.length){ elems = []; for(var l in dom.layers){ for(var e in dom.layers[l].frames[dom.currentFrameNum].elements){ if(dom.layers[l].frames[dom.currentFrameNum].elements[e].visible) elems.push(dom.layers[l].frames[dom.currentFrameNum].elements[e]); } } } // loop specified objects var oldElemsCount = elems.length; for(var e in elems){ elems = elems.concat(loopObjects(elems[e],BOUNDS)); } fw.selection = elems; if(oldElemsCount == elems.length){ alert('This operation produced no output. To use this command, select objects (or select no objects and all objects in the document will be used) that go beyond the canvas bounds and they will be looped to the opposite canvas edge.'); }else if(fw.yesNoDialog('Add mask around result?')){ dom.group(); var group = fw.selection[0]; dom.addNewRectangle(BOUNDS,0); dom.clipCut(); fw.selection = [group]; dom.clipPasteAsMask("do not resample", "vector", "replace"); fw.selection = [group]; } } //try{ LoopCanvas(); //}catch(e){ alert([e, e.lineNumber, e.fileName].join("\n")) }; // loops objects that are out of bounds // - clone and move partially overlapping vectors // - TODO: cut and move partially out of bounds bitmaps function loopObjects(elem,bounds){ var width = bounds.right - bounds.left, height = bounds.bottom - bounds.top; var newElems = []; // left doLoop(elem,elem.left,bounds.left,Infinity,{x:width,y:0}); // top left doLoop(elem,elem.left < bounds.left && elem.top < bounds.top,null,null,{x:width,y:height}); // top doLoop(elem,elem.top,bounds.top,Infinity,{x:0,y:height}); // top right doLoop(elem,elem.left + elem.width > bounds.right && elem.top < bounds.top,null,null,{x:-width,y:height}); // right doLoop(elem,elem.left + elem.width,-Infinity,bounds.right,{x:-width,y:0}); // bottom right doLoop(elem,elem.left + elem.width > bounds.right && elem.top + elem.height > bounds.bottom,null,null,{x:-width,y:-height}); // bottom doLoop(elem,elem.top + elem.height,-Infinity,bounds.bottom,{x:0,y:-height}); // bottom left doLoop(elem,elem.left < bounds.left && elem.top + elem.height > bounds.bottom,null,null,{x:width,y:-height}); return newElems; function doLoop(elem,val,min,max,moveBy){ fw.selection = [elem]; //alert([val,min,max]) if(val == true || val < min || val > max){ //alert("out of bounds"); dom.cloneSelection(); dom.moveSelectionBy(moveBy,false,false); newElems.push(fw.selection[0]); } } }