Skip to content

Commit

Permalink
Avoid divide by 0 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jonom committed Sep 24, 2014
1 parent 3f4282e commit 2fde1c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions js/jquery.focuspoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@
var hShift = 0;
var vShift = 0;

//Which is over by more?
var wR = imageW / containerW;
var hR = imageH / containerH;

if (!(containerW > 0 && containerH > 0 && imageW > 0 && imageH > 0)) {
return false; //Need dimensions to proceed
}

//Which is over by more?
var wR = imageW / containerW;
var hR = imageH / containerH;

//Reset max-width and -height
$image.css({
'max-width': '',
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.focuspoint.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2fde1c0

Please sign in to comment.