dragon icon indicating copy to clipboard operation
dragon copied to clipboard

Drag within on zoom/scale?

Open silversmurf opened this issue 9 years ago • 3 comments

Hi, great plugin, thanks!

But how to set the draggable area if the draggable object is zoomed-in an its greater than the 'within'-element?

Example: Showing an image in full-size within a box (same sizes), than zoom-in and drag it within the box, wich has the original sizes of the image. Is that possible? I think the calculations on line 300+ (if (opts.within) {) have to be changed a little bit?

thanks in advance...

silversmurf avatar Feb 01 '16 11:02 silversmurf

Hi @silversmurf, thanks for reporting this! This isn't a use case I've had yet, so I have not experienced this issue. Do you have a test case that to show the issue? Also, feel free to submit a Pull Request if you are able to find a solution.

jeremyckahn avatar Feb 01 '16 15:02 jeremyckahn

Hi Jeremy, no I don't have a test case. I'm working on a Chrome App, where I need this feature. There is a "editor area" with objects/elements within. This "editor area" have to be zoomable and draggable within a parent area. But when I zoom in, the "editor area" can be dragged out of this box.

Editor window without zoom (centered by default): dragon1

Editor window with zoom dragged (how it is): dragon2

Editor window with zoom dragged (how it should be): dragon3

silversmurf avatar Feb 01 '16 15:02 silversmurf

Ah, gotcha. I understand the issue, but I don't have the availability to fix it right now. I'm happy to work with you on integrating a Pull Request if you'd like to take a stab at it!

jeremyckahn avatar Feb 01 '16 18:02 jeremyckahn