// Project Fireworks 2000
// Kleanthis E. kleanthis@projectfireworks.com
// http://www.projectfireworks.com
if (fw.selection != null && fw.selection.length > 0) {
var theDoc = new PF_docDims();
var theSelection = new PF_selectionDims();
// Let's move it
fw.getDocumentDOM().moveSelectionTo({x:(theDoc.midX - theSelection.midX), y:(theSelection.top)}, false, false);
}
//functions ----------------------------------------------------------
function PF_docDims(){ // v.1.0
this.width = fw.getDocumentDOM().width;
this.height = fw.getDocumentDOM().height;
this.midX = (this.width)/2;
this.midY = (this.height)/2;
}
function PF_selectionDims(){ //v.1.0
var selectionBounds = fw.getDocumentDOM().getSelectionBounds();
this.left = selectionBounds.left;
this.top = selectionBounds.top;
this.right = selectionBounds.right;
this.bottom = selectionBounds.bottom;
this.midX = (this.right - this.left)/2;
this.midY = (this.bottom - this.top)/2;
}
กก |