Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the amount of grab pan area beyond the image #62

Open
p-4 opened this issue Mar 22, 2018 · 3 comments
Open

Limit the amount of grab pan area beyond the image #62

p-4 opened this issue Mar 22, 2018 · 3 comments
Labels

Comments

@p-4
Copy link

p-4 commented Mar 22, 2018

Is there a way to limit the grab pan area?

Possibly with a margin option with the ability to specify the amount in px.
Then the maximum amount of white color one could see from the edge of the image to the edge of the browser would be this margin amount in px.

I have very limited coding experience and do not know how to approach this.
Any help greatly appreciated.

grab_pan_limit_margin

@kingdido999
Copy link
Owner

If I understand your intention correctly, you wanted to keep the image body within a specified frame while grabbing to avoid part of image goes out of the browser window. There is no option to achieve this right now.

We also need to consider the potential UX issue it brings up if we add this option. For example, if an image is already scaled to fit the window, does it respect this option? Would we allow it to even scale further when we grab it? Also, it might look a little bit odd since at some point the image will just stop moving according to our grab intention...

@p-4
Copy link
Author

p-4 commented Mar 26, 2018

you wanted to keep the image body within a specified frame while grabbing to avoid part of image goes out of the browser window.

Not really. The idea is to avoid seeing too much white space, and limiting the amount of pixels the image can travel from the edge of the browser. So this would not conflict with other features I think.

I believe it is better to limit this, as the viewer does not need to be able to move the image so much that it goes half outside of his viewable area (just like I did on the attached screenshot).

This would improve the user experience even more when the background has transparency and the webpage is visible behind the zoomed image.

On the screenshot I have also put red lines to represent how much I can pan (grab) the image and see a lot of white space. The idea would be to be able to limit this and set a smaller distance (the blue lines).

capture2

@kingdido999
Copy link
Owner

kingdido999 commented Mar 28, 2018

Ok I got your point now! I'm sure such option could improve the user experience on different image conditions (size and resolution).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants