From 2dac32634eda1541b95d15f55b90992bcf456217 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 15 Nov 2012 02:20:29 +0000 Subject: [PATCH] Round rather than floor values in image editing JS to avoid decrementing values on each run. props SergeyBiryukov. fixes #22011. git-svn-id: https://develop.svn.wordpress.org/trunk@22592 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/image-edit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/js/image-edit.js b/wp-admin/js/image-edit.js index f0aed6c8c3..bc5a49c059 100644 --- a/wp-admin/js/image-edit.js +++ b/wp-admin/js/image-edit.js @@ -72,10 +72,10 @@ imageEdit = { warn = $('#imgedit-scale-warn-' + postid), w1 = '', h1 = ''; if ( x ) { - h1 = (w.val() != '') ? this.intval( w.val() / this.hold['xy_ratio'] ) : ''; + h1 = (w.val() != '') ? Math.round( w.val() / this.hold['xy_ratio'] ) : ''; h.val( h1 ); } else { - w1 = (h.val() != '') ? this.intval( h.val() * this.hold['xy_ratio'] ) : ''; + w1 = (h.val() != '') ? Math.round( h.val() * this.hold['xy_ratio'] ) : ''; w.val( w1 ); }