proNestorAps / react-zoom-pan-pinch

Fork of react-zoom-pan-pinch that fixes an issue with build warnings and another with pixelated results in Safari.
MIT License
16 stars 6 forks source link

`resetTransform` does not follow `centerOnInit` parameter #83

Open ai212983 opened 1 year ago

ai212983 commented 1 year ago

Seems like source repo also had this problem https://github.com/prc5/react-zoom-pan-pinch/issues/217:

<TransformWrapper initialScale={1} minScale={0.8} maxScale={3} centerOnInit centerZoomedOut
{({ zoomIn, zoomOut, resetTransform }) => (
...
<button className="reset" onClick={()=>resetTransform ()}>[]</button>

the workaround is to use centerView(<initialScale>), but still

janaagaard75 commented 1 year ago

The source issues has been closed as fixed by this pull request https://github.com/prc5/react-zoom-pan-pinch/commit/9e20e855c82f52fccd309f25e60b67ddfd5482cb. So just to make sure that I understand you correctly: This is still an issue, right?

ai212983 commented 1 year ago

@janaagaard75 This is still an issue with this fork (proNestorAps), not with original (prc5).

janaagaard75 commented 1 year ago

Thanks a lot for clarifying this. I have no clue as to why this fork has the issue though, because the changes (https://github.com/prc5/react-zoom-pan-pinch/commit/9e20e855c82f52fccd309f25e60b67ddfd5482cb) are also present here. I will have to create a test that reproduces the error, and then try rolling back the changes applied in here since the fork.