woutervh-/react-pan-and-zoom-hoc

`1.3.0` breaks zooming

Closed this issue · 2 comments

Thanks for the quick update to #5.

After updating to the latest 1.3.0, zooming is broken for me. I see that there were changes to fix #4, but it was working for me before in my project. Here is a demo using 1.1.11 with zooming working.

Here is where I implement react-pan-and-zoom-hoc. Do you see where I am going wrong? In my handlePanAndZoom callback I've tried changing:

const zoomXOffset = prevXoffset + (prevXoffset - xOffset);
const zoomYOffset = prevYOffset + (prevYOffset - yOffset);

to:

const zoomXOffset = xOffset;
const zoomYOffset = yOffset;

hi @schlesiger

Thanks for the report. However nothing should have changed in version 1.3.0 regarding zoom logic. You mentioned that you were on 1.1.11. There was a change 1.1.12 that changed some of the pan/zoom logic:
25dbf48?diff=split#diff-ab43f4870721a4f70d3bfd052c4046ebL36

With the new examples file you can see how the x, y, and zoom values change:
https://github.com/woutervh-/react-pan-and-zoom-hoc/blob/master/examples/main.js#L46

Closing for house keeping.