added clear svg function
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@8 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
899d973ffb
commit
76c17ae3e8
15
blanksvg.js
15
blanksvg.js
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue