From b23502fba4a50226cb7a302370038b76897d9d24 Mon Sep 17 00:00:00 2001 From: Magne Bratseth Date: Tue, 9 Feb 2016 15:16:44 +0100 Subject: [PATCH] Do not strip rx=0 and ry=0 from ellipse elements as these values are not default and holds a special meaning for ellipses (a value of 0 disables rendering of the element) --- editor/svgutils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/svgutils.js b/editor/svgutils.js index befbb302..4d5814aa 100644 --- a/editor/svgutils.js +++ b/editor/svgutils.js @@ -620,6 +620,7 @@ svgedit.utilities.assignAttributes = function(node, attrs, suspendLength, unitCh // Parameters: // element - DOM element to clean up svgedit.utilities.cleanupElement = function(element) { + var nodeName = element.nodeName ? element.nodeName : ''; var defaults = { 'fill-opacity':1, 'stop-opacity':1, @@ -630,8 +631,8 @@ svgedit.utilities.cleanupElement = function(element) { 'stroke-linecap':'butt', 'stroke-opacity':1, 'stroke-width':1, - 'rx':0, - 'ry':0 + 'rx': (nodeName == 'ellipse' ? null : 0), // rx=0 and ry=0 is valid value which are different than null/empty + 'ry': (nodeName == 'ellipse' ? null : 0) }; var attr;