From 76f967a9fd408fdf90aa3d0ddc1f69b3e6b819f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9Aonstantin=20Liuterovich?= Date: Thu, 28 May 2015 17:42:34 +0800 Subject: [PATCH] Update jquery.Jcrop.js fix bug - maxSize option now working without this fix --- js/jquery.Jcrop.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/jquery.Jcrop.js b/js/jquery.Jcrop.js index 09b1bcf7..e9a24f61 100644 --- a/js/jquery.Jcrop.js +++ b/js/jquery.Jcrop.js @@ -655,11 +655,11 @@ ysize = y2 - y1, delta; - if (xlimit && (Math.abs(xsize) > xlimit)) { - x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit); + if (xlimit && (Math.abs(xsize) > xlimit / xscale)) { + x2 = (xsize > 0) ? (x1 + xlimit / xscale) : (x1 - xlimit / xscale); } - if (ylimit && (Math.abs(ysize) > ylimit)) { - y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit); + if (ylimit && (Math.abs(ysize) > ylimit / yscale)) { + y2 = (ysize > 0) ? (y1 + ylimit / yscale) : (y1 - ylimit / yscale); } if (ymin / yscale && (Math.abs(ysize) < ymin / yscale)) {