From 289bed8fd20619b3986088aa75386af4afd48646 Mon Sep 17 00:00:00 2001 From: Martin Meixger Date: Mon, 12 May 2014 15:34:50 +0200 Subject: [PATCH] change negative coordinates to zero --- .../src/common/services/cropperhelper.service.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/cropperhelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/cropperhelper.service.js index 5c9e78777a..747adfe843 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/cropperhelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/cropperhelper.service.js @@ -114,11 +114,10 @@ function cropperHelper(umbRequestHelper, $http) { crop.x2 = x2_px / image.width; crop.y2 = y2_px / image.height; - _.forEach(crop, function(coord){ - if(coord < 0){ - coord = 0; - } - }); + for(var coord in crop){ + if(crop[coord] < 0) + crop[coord] = 0; + } return crop; },