fw.getDocumentDOM().clipCopy(); var currentRect= fw.selection[0]; var _right = currentRect.left + currentRect.width; var _bottom = currentRect.top + currentRect.height; var _roundness = currentRect.roundness; var mode = currentRect.mode; fw.getDocumentDOM().deleteSelection(false); fw.getDocumentDOM().addNewRectanglePrimitive({ left:currentRect.left, top:currentRect.top, right:_right, bottom:_bottom }, 0); fw.getDocumentDOM().clipPasteAttributes(); fw.getDocumentDOM().setRectRoundness(_roundness, mode);