From 923aa6abb6b538ccd8a0866bbd4d14f24805f5e6 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Wed, 14 Oct 2009 03:03:13 +0000 Subject: [PATCH] Fix Issue 231: Opera again now shows shapes being redrawn. Opera does not like suspendRedraw() apparently git-svn-id: http://svg-edit.googlecode.com/svn/trunk@821 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 01d45b9c..91b9dd74 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -552,14 +552,16 @@ function BatchCommand(text) { var assignAttributes = function(node, attrs, suspendLength) { if(!suspendLength) suspendLength = 0; - var handle = svgroot.suspendRedraw(suspendLength); + // Opera has a problem with suspendRedraw() apparently + var handle = null; + if (!window.opera) svgroot.suspendRedraw(suspendLength); for (i in attrs) { var ns = (i.substr(0,4) == "xml:" ? xmlns : null); node.setAttributeNS(ns, i, attrs[i]); } - svgroot.unsuspendRedraw(handle); + if (!window.opera) svgroot.unsuspendRedraw(handle); }; // remove unneeded attributes @@ -1942,10 +1944,12 @@ function BatchCommand(text) { },1000); break; case "line": - var handle = svgroot.suspendRedraw(1000); + // Opera has a problem with suspendRedraw() apparently + var handle = null; + if (!window.opera) svgroot.suspendRedraw(1000); shape.setAttributeNS(null, "x2", x); shape.setAttributeNS(null, "y2", y); - svgroot.unsuspendRedraw(handle); + if (!window.opera) svgroot.unsuspendRedraw(handle); break; case "square": var size = Math.max( Math.abs(x - start_x), Math.abs(y - start_y) ); @@ -1981,10 +1985,12 @@ function BatchCommand(text) { case "ellipse": var cx = shape.getAttributeNS(null, "cx"); var cy = shape.getAttributeNS(null, "cy"); - var handle = svgroot.suspendRedraw(1000); + // Opera has a problem with suspendRedraw() apparently + var handle = null; + if (!window.opera) svgroot.suspendRedraw(1000); shape.setAttributeNS(null, "rx", Math.abs(x - cx) ); shape.setAttributeNS(null, "ry", Math.abs(y - cy) ); - svgroot.unsuspendRedraw(handle); + if (!window.opera) svgroot.unsuspendRedraw(handle); break; case "fhellipse": case "fhrect":