From 3777b53507dd770c2de0b50dd6217ca07248c156 Mon Sep 17 00:00:00 2001 From: gwills Date: Tue, 22 Oct 2013 13:54:32 +0100 Subject: [PATCH] Revert "Fix rotate on rectangular overalys" This reverts commit a70d082be3e9c3b961a217a712aca762f42ba653. --- src/overlay.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/overlay.js b/src/overlay.js index f3df6cfb..b828ac9e 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -211,14 +211,13 @@ // TODO replace the size rotation with CSS3 transforms // TODO add an option to overlays to not rotate with the image // Currently only rotates position and size - if( degrees !== 0 ) { - overlayCenter = new $.Point( size.x / 2, size.y / 2 ); - var overlayCenterAfterRotate = (degrees === 0 || degrees === 180) ? overlayCenter : new $.Point( size.y / 2, size.x / 2 ); - + if( degrees !== 0 && this.scales ) { + overlayCenter = new $.Point( size.x / 2, size.y / 2 ); + position = position.plus( overlayCenter ).rotate( degrees, drawerCenter - ).minus( overlayCenterAfterRotate ); + ).minus( overlayCenter ); size = size.rotate( degrees, new $.Point( 0, 0 ) ); size = new $.Point( Math.abs( size.x ), Math.abs( size.y ) );