From 244e54da69ec16dbb874c1e6fcf03d5155b764ed Mon Sep 17 00:00:00 2001 From: donotloveshampo <594344517@qq.com> Date: Fri, 17 Mar 2023 16:27:12 +0800 Subject: [PATCH] Fixed #2314 --- src/navigator.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/navigator.js b/src/navigator.js index f7fe611e..c7c8419b 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -399,11 +399,11 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /* var style = this.displayRegion.style; style.display = this.world.getItemCount() ? 'block' : 'none'; - style.top = Math.round( topleft.y ) + 'px'; - style.left = Math.round( topleft.x ) + 'px'; + style.top = topleft.y.toFixed(2) + "px"; + style.left = topleft.x.toFixed(2) + "px"; - var width = Math.abs( topleft.x - bottomright.x ); - var height = Math.abs( topleft.y - bottomright.y ); + var width = bottomright.x - topleft.x; + var height = bottomright.y - topleft.y; // make sure width and height are non-negative so IE doesn't throw style.width = Math.round( Math.max( width, 0 ) ) + 'px'; style.height = Math.round( Math.max( height, 0 ) ) + 'px';