Remove all suspendRedraws
This commit is contained in:
@@ -93,6 +93,7 @@ svgedit.select.Selector.prototype.reset = function(e) {
|
||||
this.selectorGroup.setAttribute('display', 'inline');
|
||||
};
|
||||
|
||||
|
||||
// Function: svgedit.select.Selector.updateGripCursors
|
||||
// Updates cursors for corner grips on rotation so arrows point the right way
|
||||
//
|
||||
@@ -123,7 +124,6 @@ svgedit.select.Selector.prototype.updateGripCursors = function(angle) {
|
||||
// Parameters:
|
||||
// show - boolean indicating whether grips should be shown or not
|
||||
svgedit.select.Selector.prototype.showGrips = function(show) {
|
||||
// TODO: use suspendRedraw() here
|
||||
var bShow = show ? 'inline' : 'none';
|
||||
selectorManager_.selectorGripsGroup.setAttribute('display', bShow);
|
||||
var elem = this.selectedElement;
|
||||
@@ -222,7 +222,6 @@ svgedit.select.Selector.prototype.resize = function() {
|
||||
nbaw = (maxx-minx);
|
||||
nbah = (maxy-miny);
|
||||
}
|
||||
var sr_handle = svgFactory_.svgRoot().suspendRedraw(100);
|
||||
|
||||
var dstr = 'M' + nbax + ',' + nbay
|
||||
+ ' L' + (nbax+nbaw) + ',' + nbay
|
||||
@@ -261,8 +260,6 @@ svgedit.select.Selector.prototype.resize = function() {
|
||||
mgr.rotateGrip.setAttribute('cx', nbax + (nbaw)/2);
|
||||
mgr.rotateGrip.setAttribute('cy', nbay - (gripRadius*5));
|
||||
// }
|
||||
|
||||
svgFactory_.svgRoot().unsuspendRedraw(sr_handle);
|
||||
};
|
||||
|
||||
|
||||
@@ -450,12 +447,12 @@ svgedit.select.SelectorManager.prototype.releaseSelector = function(elem) {
|
||||
var i,
|
||||
N = this.selectors.length,
|
||||
sel = this.selectorMap[elem.id];
|
||||
if (!sel.locked) {
|
||||
// TODO(codedread): Ensure this exists in this module.
|
||||
console.log('WARNING! selector was released but was already unlocked');
|
||||
}
|
||||
for (i = 0; i < N; ++i) {
|
||||
if (this.selectors[i] && this.selectors[i] == sel) {
|
||||
if (sel.locked == false) {
|
||||
// TODO(codedread): Ensure this exists in this module.
|
||||
console.log('WARNING! selector was released but was already unlocked');
|
||||
}
|
||||
delete this.selectorMap[elem.id];
|
||||
sel.locked = false;
|
||||
sel.selectedElement = null;
|
||||
|
||||
@@ -1896,10 +1896,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||
}, 1000);
|
||||
break;
|
||||
case 'line':
|
||||
// Opera has a problem with suspendRedraw() apparently
|
||||
var handle = null;
|
||||
if (!window.opera) {svgroot.suspendRedraw(1000);}
|
||||
|
||||
if (curConfig.gridSnapping) {
|
||||
x = svgedit.utilities.snapToGrid(x);
|
||||
y = svgedit.utilities.snapToGrid(y);
|
||||
@@ -1916,7 +1912,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||
|
||||
shape.setAttributeNS(null, 'x2', x2);
|
||||
shape.setAttributeNS(null, 'y2', y2);
|
||||
if (!window.opera) {svgroot.unsuspendRedraw(handle);}
|
||||
break;
|
||||
case 'foreignObject':
|
||||
// fall through
|
||||
@@ -1967,9 +1962,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||
c = $(shape).attr(['cx', 'cy']);
|
||||
cx = c.cx;
|
||||
cy = c.cy;
|
||||
// Opera has a problem with suspendRedraw() apparently
|
||||
handle = null;
|
||||
if (!window.opera) {svgroot.suspendRedraw(1000);}
|
||||
if (curConfig.gridSnapping) {
|
||||
x = svgedit.utilities.snapToGrid(x);
|
||||
cx = svgedit.utilities.snapToGrid(cx);
|
||||
@@ -1979,7 +1971,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||
shape.setAttributeNS(null, 'rx', Math.abs(x - cx) );
|
||||
var ry = Math.abs(evt.shiftKey?(x - cx):(y - cy));
|
||||
shape.setAttributeNS(null, 'ry', ry );
|
||||
if (!window.opera) {svgroot.unsuspendRedraw(handle);}
|
||||
break;
|
||||
case 'fhellipse':
|
||||
case 'fhrect':
|
||||
@@ -5681,7 +5672,6 @@ this.setResolution = function(x, y) {
|
||||
}
|
||||
}
|
||||
if (x != w || y != h) {
|
||||
var handle = svgroot.suspendRedraw(1000);
|
||||
if (!batchCmd) {
|
||||
batchCmd = new svgedit.history.BatchCommand('Change Image Dimensions');
|
||||
}
|
||||
@@ -5700,7 +5690,6 @@ this.setResolution = function(x, y) {
|
||||
batchCmd.addSubCommand(new svgedit.history.ChangeElementCommand(svgcontent, {'viewBox': ['0 0', w, h].join(' ')}));
|
||||
|
||||
addCommandToHistory(batchCmd);
|
||||
svgroot.unsuspendRedraw(handle);
|
||||
call('changed', [svgcontent]);
|
||||
}
|
||||
return true;
|
||||
@@ -6770,7 +6759,6 @@ this.convertToPath = function(elem, getBBox) {
|
||||
// newValue - String or number with the new attribute value
|
||||
// elems - The DOM elements to apply the change to
|
||||
var changeSelectedAttributeNoUndo = function(attr, newValue, elems) {
|
||||
var handle = svgroot.suspendRedraw(1000);
|
||||
if (current_mode == 'pathedit') {
|
||||
// Editing node
|
||||
pathActions.moveNode(attr, newValue);
|
||||
@@ -6883,7 +6871,6 @@ var changeSelectedAttributeNoUndo = function(attr, newValue, elems) {
|
||||
}
|
||||
} // if oldValue != newValue
|
||||
} // for each elem
|
||||
svgroot.unsuspendRedraw(handle);
|
||||
};
|
||||
|
||||
// Function: changeSelectedAttribute
|
||||
|
||||
@@ -603,11 +603,6 @@ if (svgedit.browser.supportsSelectors()) {
|
||||
// suspendLength - Optional integer of milliseconds to suspend redraw
|
||||
// unitCheck - Boolean to indicate the need to use svgedit.units.setUnitAttr
|
||||
svgedit.utilities.assignAttributes = function(node, attrs, suspendLength, unitCheck) {
|
||||
if(!suspendLength) {suspendLength = 0;}
|
||||
// Opera has a problem with suspendRedraw() apparently
|
||||
var handle = null;
|
||||
if (!svgedit.browser.isOpera()) {svgroot_.suspendRedraw(suspendLength);}
|
||||
|
||||
var i;
|
||||
for (i in attrs) {
|
||||
var ns = (i.substr(0,4) === 'xml:' ? NS.XML :
|
||||
@@ -621,7 +616,6 @@ svgedit.utilities.assignAttributes = function(node, attrs, suspendLength, unitCh
|
||||
svgedit.units.setUnitAttr(node, i, attrs[i]);
|
||||
}
|
||||
}
|
||||
if (!svgedit.browser.isOpera()) {svgroot_.unsuspendRedraw(handle);}
|
||||
};
|
||||
|
||||
// Function: cleanupElement
|
||||
@@ -630,7 +624,6 @@ svgedit.utilities.assignAttributes = function(node, attrs, suspendLength, unitCh
|
||||
// Parameters:
|
||||
// element - DOM element to clean up
|
||||
svgedit.utilities.cleanupElement = function(element) {
|
||||
var handle = svgroot_.suspendRedraw(60);
|
||||
var defaults = {
|
||||
'fill-opacity':1,
|
||||
'stop-opacity':1,
|
||||
@@ -652,8 +645,6 @@ svgedit.utilities.cleanupElement = function(element) {
|
||||
element.removeAttribute(attr);
|
||||
}
|
||||
}
|
||||
|
||||
svgroot_.unsuspendRedraw(handle);
|
||||
};
|
||||
|
||||
// Function: snapToGrid
|
||||
|
||||
Reference in New Issue
Block a user