matiasgali / guillotine

jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
http://guillotine.js.org
326 stars 100 forks source link

Unable to determine how to drag coordinates of any portion of image in the view #66

Open milindk opened 6 years ago

milindk commented 6 years ago

I'm drawing the image to be guillotined in canvas and then zoom in or out the canvas itself. As a part of functionality I'm also drawing squared rectangles over it, for which I've written custom logic.

However, if I zoom in the image and then draw something over it, then being scaled image viewer gets an impression as portion intended for highlighting is not actually highlighted, although user is not able to see it in the current view and needs to manually drag image to search the highlighted portion.

I'm trying to establish this manual dragging as automated to the portion highlighted since we've coordinates of the portion highlighted. However, I'm not sure if it is at all doable with the plugin at all.

As per my understanding plugin does certain calculations while dragging is manual. But how to automate it is something I'm unclear about. It'd be of great help if someone can suggest any approach.

Thanks in advance.