bumbu / svg-pan-zoom

JavaScript library that enables panning and zooming of an SVG in an HTML document, with mouse events or custom JavaScript hooks
https://github.com/ariutta/svg-pan-zoom#demos
BSD 2-Clause "Simplified" License
1.74k stars 390 forks source link

Thumbnail click point of reference breaks after zoom. #418

Open menocsk27 opened 2 years ago

menocsk27 commented 2 years ago

Bug report

Expected behaviour

Click should be related to the center or a corner of the thumbnail view box.

Actual behaviour

Click loses reference to the thumbnail view box

Steps to reproduce the behaviour

  1. Open the thumbnail demo https://bumbu.me/svg-pan-zoom/demo/thumbnailViewer.html
  2. Click somewhere on the thumbnail, the view box will snap its center to the mouse position (kinda, it already breaks towards the upper left corner)
  3. Zoom in for more clarity, example: image
  4. Clicking anywhere on the thumbnail shows that the mouse is not aligned to the view box anymore, it snaps to other places.

Gif version of these steps: thumbnail viewer bug

Configuration

Minniball commented 2 years ago

I need the feature as well, can someone solve the issue?