No idea if this affects any other part of the code, but it works for
me and has presented me with no problems.
Simply replace the existing clearRect function with this:
contextPrototype.clearRect = function(x, y, width, height) {
if (x >= 0 && y >= 0 && width>= 0 && height >= 0) {
for (var i = 0; i < this.element_.childNodes.length; i++) {
var shape = this.element_.childNodes[i];
if (shape.offsetLeft >= x && shape.offsetTop >= y &&
(shape.offsetLeft + shape.offsetWidth) <= (x + width) &&
(shape.offsetTop + shape.offsetHeight) <= (y + height)) {
this.element_.removeChild(shape);
i--;
}
}
}
else {
alert(x + ", " + y + ", " + width + ", " + height);
this.element_.innerHTML = "";
}
this.currentPath_ = [];
};
This is rough and dirty and could be optimized, but it's working on my
system. I will try to clean it up and error detect and resubmit later.
Let me know how it works for you.
On Apr 21, 12:30 pm, "Erik Arvidsson" <
erik.arvids...@gmail.com>
wrote:
> Yes, clearRect is not implemented. We always clear the entire canvas,
> which is a common usecase. Clearing a rectangle requires clipping
> paths or some other mechanism and I don't think VML gives us that
> power.
>
> On Sun, Apr 20, 2008 at 14:39, Nicolas Garcia Belmonte
>