Hello,
I am trying to temporarily disable zoom in my visualization. I save the current zoom and translation values when the zoom is disabled and re-set the zoom zoom.scale and zoom.translate when the zoom is re-enabled. But it does not work as expected. I made a simple example here :
http://jsfiddle.net/La8PR/5/
The zooming/scaling seems to be working. But the translation works not as expected. Here how to reproduce the behavior :
1. Click on the circle - it changes the color to blue, translation is disabled
2. Drag the background in one direction with the mouse as if you would pan
3. Click on the circle again, it is getting red, the zooming is re-enabled now
4. Drag the background again - it makes a jump to the position where you moved it when the zooming was disabled
Strange thing is, that the same procedure works well for the scaling.
I am not able to find my mistahe, could please anyone help me ?