|
|
@ -1835,27 +1835,7 @@ function PaintWeb (win, doc) {
|
|
|
|
h = MathMin(image.height, himg.height);
|
|
|
|
h = MathMin(image.height, himg.height);
|
|
|
|
|
|
|
|
|
|
|
|
layerContext.clearRect(0, 0, image.width, image.height);
|
|
|
|
layerContext.clearRect(0, 0, image.width, image.height);
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
// Firefox 3 does not clip the image, if needed.
|
|
|
|
|
|
|
|
layerContext.putImageData(himg, 0, 0, 0, 0, w, h);
|
|
|
|
layerContext.putImageData(himg, 0, 0, 0, 0, w, h);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
// The workaround is to use a new canvas from which we can copy the
|
|
|
|
|
|
|
|
// history image without causing any exceptions.
|
|
|
|
|
|
|
|
var tmp = doc.createElement('canvas');
|
|
|
|
|
|
|
|
tmp.width = himg.width;
|
|
|
|
|
|
|
|
tmp.height = himg.height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tmp2 = tmp.getContext('2d');
|
|
|
|
|
|
|
|
tmp2.putImageData(himg, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
layerContext.drawImage(tmp, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tmp2 = tmp = null;
|
|
|
|
|
|
|
|
delete tmp2, tmp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
history.pos = pos;
|
|
|
|
history.pos = pos;
|
|
|
|
|
|
|
|
|
|
|
|
this.events.dispatch(new appEvent.historyUpdate(pos, cpos,
|
|
|
|
this.events.dispatch(new appEvent.historyUpdate(pos, cpos,
|
|
|
|