viewerjs icon indicating copy to clipboard operation
viewerjs copied to clipboard

zoom/rotate based on center of screen instead of center of image

Open codemasterover9000 opened this issue 6 years ago • 3 comments

Hi,

Image manipulation tools (zoom/rotate) all operate based on the center of the image. So when for example the image is very tall and zoomed in. The center of the image is way outside the screen. Rotating the image will make it disappear.

Making the operations work based on the center of the screen fixes these problems and feels more natural to the end user (IMO).

Thanks

codemasterover9000 avatar Sep 06 '18 15:09 codemasterover9000

Same goes for the '1:1' button: when zoomed in on a specific part of the image (say the left top corner) and pressing the '1:1' button, the images disappears from the screen. Pressing the 'reset' button re-positions the image.

IMHO this is a bug, not an enhancement.

achilleus68 avatar Jan 21 '19 08:01 achilleus68

  1. When calling the zoom or rotate methods, the zoom / rotate center is the center of the canvas (image wrapper).
  2. When zoom by wheel or touch, the zoom center is the position of the pointer.

fengyuanchen avatar Jan 26 '19 07:01 fengyuanchen

But it should be possible the center the image on screen when pressing the '1:1' button.

achilleus68 avatar Jan 29 '19 20:01 achilleus68