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

optional arg 'focusRect' 'crops' the image to that rect #90

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

morphil
Copy link

@morphil morphil commented Jan 13, 2016

No description provided.

with a set of helper functions.
*/
var isValidFocusRect = function (focusRect) {
return !!focusRect && typeof focusRect === 'object' && focusRect.top && focusRect.left && focusRect.width && focusRect.height;
Copy link

@psalv psalv Dec 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if width and height can be 0 here, but it seems top and left should be able to

Suggested change
return !!focusRect && typeof focusRect === 'object' && focusRect.top && focusRect.left && focusRect.width && focusRect.height;
return !!focusRect && typeof focusRect === 'object' && focusRect.top !== undefined && focusRect.left !== undefined && focusRect.width !== undefined && focusRect.height !== undefined;

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

Successfully merging this pull request may close these issues.

None yet

3 participants