jquave/raphael-zpd — pull request #2 by jkpathan (2012-08-19 15:18:23+00:00)
Title: Multiple Mousewheel events on paper.clear()

If paper.clear() is called, you need to re-create a new zpd but doing that creates a duplicate mousewheel event. This bugfix has been tested on the latest Chrome, Firefox and IE9.

Following code will replicate the bug:

<script src="js/raphael-min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/raphael-zpd.js" type="text/javascript" charset="utf-8"></script>
<div id="raphaelDiv">
<script>
paper = Raphael("raphaelDiv", 400, 400);
zpd = new RaphaelZPD(paper, { zoom: true, pan: true, drag: false });
paper.path("M100 100L200 200");
paper.clear();
zpd = new RaphaelZPD(paper, { zoom: true, pan: true, drag: false });
paper.path("M100 100L200 200");
</script>

You will see the following error in the javascript console:
Cannot call method 'getCTM' of null