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

imgAreaSelect doesn't recognized padding #45

Open
Huji opened this issue Jul 31, 2013 · 3 comments · May be fixed by #46
Open

imgAreaSelect doesn't recognized padding #45

Huji opened this issue Jul 31, 2013 · 3 comments · May be fixed by #46

Comments

@Huji
Copy link

Huji commented Jul 31, 2013

If the image in question has a border and padding, the area that can be selected extends to the border, not just over the image. In other words, areas OUTSIDE the image are selectable.

How to test it:
Go to http://odyniec.net/projects/imgareaselect/examples.html and scroll to the bottom to see the duck example. Then in console run this:

$('#duck').css('border:1px solid red').css('padding', '4px');

You will see the grey box extends to the border, and goes beyond the image.

@Huji
Copy link
Author

Huji commented Jul 31, 2013

Solution:

Change the section that is titled /* Get image dimensions */ (lines 273-274 in 3817ae0) to:

        imgWidth = $img.width();
        imgHeight = $img.height();

Mithgol added a commit to Mithgol/imgareaselect that referenced this issue Aug 1, 2013
@Mithgol Mithgol linked a pull request Aug 1, 2013 that will close this issue
@Mithgol
Copy link

Mithgol commented Aug 1, 2013

@Huji You should have made a pull request (such as #46) out of your solution.

@Huji
Copy link
Author

Huji commented Aug 1, 2013

Thanks. Will do next time.

By the way, I tried it in two different browsers and seem like it solves the problem.

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

Successfully merging a pull request may close this issue.

2 participants