added clear svg function

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@8 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Narendra Sisodiya 2009-02-13 09:32:31 +00:00
parent 899d973ffb
commit 76c17ae3e8
1 changed files with 55 additions and 50 deletions

View File

@ -319,12 +319,17 @@ function assignAttr(Node,Attr){
function SVGclear_svg()
{
for(var i=1; i<path_num; i++){
var element = SVGDocument.getElementById("path_" + i);
if(element != null ) { element.parentNode.removeChild(element); }
var Nodes = SVGRoot.childNodes ;
var Length = SVGRoot.childNodes.length ;
var i = 0 ;
for(var Rep=0; Rep< Length; Rep++){
if(Nodes[i].nodeType == 1){
Nodes[i].parentNode.removeChild(Nodes[i]);
}
path_num = 1 ;
else{
i++;
}
}//for
}