Skip to content

Commit

Permalink
fix up type checking in result image size setter
Browse files Browse the repository at this point in the history
  • Loading branch information
chirgwin committed Jul 30, 2014
1 parent ed1a87b commit e11cec8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/js/classes/crop-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,15 @@ crop.factory('cropHost', ['$document', 'cropAreaCircle', 'cropAreaSquare', 'crop
return;
}

//allow setting of size to "selection" for mirroring selection's dimensions
if (angular.isString(size))
{
resImgSize = size;
return;
}

//allow scalar values for square-like selection shapes
if (typeof size === "number")
if (angular.isNumber(size))
{
size = parseInt(size, 10);
size = {w: size,
Expand Down

0 comments on commit e11cec8

Please sign in to comment.