From 52007a46c116d3469dfb14effd22f4057b88a16f 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: http://core.svn.wordpress.org/trunk@22592 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 ); }