daybrush / infinite-viewer

Infinite Viewer is Document Viewer Component with infinite scrolling.
https://daybrush.com/infinite-viewer/
MIT License
296 stars 33 forks source link

Contrary to documentaion, zoom needs to be used with zoomX and zoomY #58

Open longtengz opened 1 year ago

longtengz commented 1 year ago

We were previously using vue2-infinite-viewer (a version prior to this change https://github.com/daybrush/infinite-viewer/commit/ea62972f118ad87d1388fec33e110539c4feee03). And we only need to set zoom.

But when we update to the newest version of vue3-infinite-viewer (which has the zoomX and zoomY change), setting zoom alone does not work as the style shows that scale is still (1, 1) which contradicts with our value 0.75 for zoom.

After some digging, I saw this change https://github.com/daybrush/infinite-viewer/commit/ea62972f118ad87d1388fec33e110539c4feee03 , and found that upon rendering it's using zoomX=1, zoomY=1. So I pass in zoomX=0.75and zoomY=0.75 alongside with zoom=0.75, and voila it works.

However, when reading the documentation it clearly says do not use them together,

If you use the zoom property, don't use the zoomX and zoomY properties.

so I think there's something wrong with the implementation.

daybrush commented 1 year ago

@longtengz I checked and it works fine.

It is my intention to use only zoom or only (zomX, zoomY).

Is there a demo I can check out?