From 11024f44f22d84329c99d1d261c2e8c43e857968 Mon Sep 17 00:00:00 2001 From: Serge Markin Date: Thu, 20 Aug 2015 20:11:30 +0800 Subject: [PATCH] FIXED: Rotation works improperly on retina display #683 --- src/drawer.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/drawer.js b/src/drawer.js index 939a8cf0..9b74b981 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -488,29 +488,18 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{ // private _offsetForRotation: function( tile, degrees, useSketch ){ var cx = this.canvas.width / 2, - cy = this.canvas.height / 2, - px = tile.position.x - cx, - py = tile.position.y - cy; + cy = this.canvas.height / 2; var context = this._getContext( useSketch ); context.save(); context.translate(cx, cy); context.rotate( Math.PI / 180 * degrees); - tile.position.x = px; - tile.position.y = py; + context.translate(-cx, -cy); }, // private _restoreRotationChanges: function( tile, useSketch ){ - var cx = this.canvas.width / 2, - cy = this.canvas.height / 2, - px = tile.position.x + cx, - py = tile.position.y + cy; - - tile.position.x = px; - tile.position.y = py; - var context = this._getContext( useSketch ); context.restore(); },