From c3ed1b9bdfe528664aa13258781ffafaeed62e1d Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 1 Jan 2010 15:49:50 +0000 Subject: [PATCH] Fixed issue 321: Path editing doesn't work in Firefox 1.5 and Firefox 2.0 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1137 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 64 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 340315d4..86526c1c 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -34,6 +34,8 @@ function SvgCanvas(container) var isOpera = !!window.opera; var isWebkit = navigator.userAgent.indexOf("AppleWebKit") != -1; +var support = {}; + // this defines which elements and attributes that we support // TODO: add elements to this // TODO: add to this @@ -3591,7 +3593,26 @@ function BatchCommand(text) { if(!path) path = current_path; var func = 'createSVGPathSeg' + pathFuncs[type]; var seg = path[func].apply(path, pts); - path.pathSegList.replaceItem(seg, index); + + if(support.pathReplaceItem) { + path.pathSegList.replaceItem(seg, index); + } else { + var segList = path.pathSegList; + var len = segList.numberOfItems; + var arr = []; + for(var i=0; i