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
master
Jeff Schiller 2009-10-14 03:03:13 +00:00
parent 87811c0fb8
commit 923aa6abb6
1 changed files with 12 additions and 6 deletions

View File

@ -552,14 +552,16 @@ function BatchCommand(text) {
var assignAttributes = function(node, attrs, suspendLength) { var assignAttributes = function(node, attrs, suspendLength) {
if(!suspendLength) suspendLength = 0; 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) { for (i in attrs) {
var ns = (i.substr(0,4) == "xml:" ? xmlns : null); var ns = (i.substr(0,4) == "xml:" ? xmlns : null);
node.setAttributeNS(ns, i, attrs[i]); node.setAttributeNS(ns, i, attrs[i]);
} }
svgroot.unsuspendRedraw(handle); if (!window.opera) svgroot.unsuspendRedraw(handle);
}; };
// remove unneeded attributes // remove unneeded attributes
@ -1942,10 +1944,12 @@ function BatchCommand(text) {
},1000); },1000);
break; break;
case "line": 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, "x2", x);
shape.setAttributeNS(null, "y2", y); shape.setAttributeNS(null, "y2", y);
svgroot.unsuspendRedraw(handle); if (!window.opera) svgroot.unsuspendRedraw(handle);
break; break;
case "square": case "square":
var size = Math.max( Math.abs(x - start_x), Math.abs(y - start_y) ); var size = Math.max( Math.abs(x - start_x), Math.abs(y - start_y) );
@ -1981,10 +1985,12 @@ function BatchCommand(text) {
case "ellipse": case "ellipse":
var cx = shape.getAttributeNS(null, "cx"); var cx = shape.getAttributeNS(null, "cx");
var cy = shape.getAttributeNS(null, "cy"); 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, "rx", Math.abs(x - cx) );
shape.setAttributeNS(null, "ry", Math.abs(y - cy) ); shape.setAttributeNS(null, "ry", Math.abs(y - cy) );
svgroot.unsuspendRedraw(handle); if (!window.opera) svgroot.unsuspendRedraw(handle);
break; break;
case "fhellipse": case "fhellipse":
case "fhrect": case "fhrect":