From f639150fed5ad674eb0e54ee65c864c34d479b57 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Mon, 31 Jan 2011 20:02:24 +0000 Subject: [PATCH] Fixed Issue 769: Text tool defaults to white in FF4 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1960 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 4a5ac131..de57d94a 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1053,7 +1053,8 @@ var getRefElem = this.getRefElem = function(attrVal) { } // Function: ffClone -// Hack for Firefox bugs where text element features aren't updated. +// Hack for Firefox bugs where text element features aren't updated or get +// messed up. See issue 136 and issue 137. // This function clones the element and re-selects it // TODO: Test for this bug on load and add it to "support" object instead of // browser sniffing @@ -8695,7 +8696,11 @@ var changeSelectedAttributeNoUndo = function(attr, newValue, elems) { if (attr == "#text") { var old_w = getBBox(elem).width; elem.textContent = newValue; - elem = ffClone(elem); + + // FF bug occurs on on transformed elements + if(elem.getAttribute('transform')) { + elem = ffClone(elem); + } // Hoped to solve the issue of moving text with text-anchor="start", // but this doesn't actually fix it. Hopefully on the right track, though. -Fyrd