From 2bef2e882fe53a655afb70aec5a45084d82649e5 Mon Sep 17 00:00:00 2001 From: gwills Date: Sat, 7 Sep 2013 17:08:39 +0100 Subject: [PATCH 1/5] IE 10 not reading DZI file correctly IE 10 is treating the data coming back from the JSONP request as a string and not as XML. I have confirmed this issue is happening on numerous IE10 machines but have not seen it on any other browser. The change simply checks the type of the data variable and if it is a string it parses the string as XML and updates the data object. --- src/tilesource.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tilesource.js b/src/tilesource.js index fce3cbb3..9055047b 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -299,6 +299,10 @@ $.TileSource.prototype = { } callback = function( data ){ + if( typeof(data) === "string" ) { + var tmp = new DOMParser(); + data = tmp.parseFromString( data , "text/xml" ); + } var $TileSource = $.TileSource.determineType( _this, data, url ); if ( !$TileSource ) { _this.raiseEvent( 'open-failed', { message: "Unable to load TileSource", source: url } ); From 8f2999da29e780952c732abe06df43dae99cd856 Mon Sep 17 00:00:00 2001 From: gwills Date: Tue, 24 Sep 2013 21:49:54 +0100 Subject: [PATCH 2/5] Use $.parseXml for parsing string as XML --- src/tilesource.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index 9055047b..8abe8cf0 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -300,8 +300,7 @@ $.TileSource.prototype = { callback = function( data ){ if( typeof(data) === "string" ) { - var tmp = new DOMParser(); - data = tmp.parseFromString( data , "text/xml" ); + data = $.parseXml( data ); } var $TileSource = $.TileSource.determineType( _this, data, url ); if ( !$TileSource ) { From f8a03157573dad376344f8c9155de3ce6aeacf8e Mon Sep 17 00:00:00 2001 From: gwills Date: Tue, 24 Sep 2013 21:54:54 +0100 Subject: [PATCH 3/5] Small formatting change Needed to change spacing to pass through jshint --- src/tilesource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tilesource.js b/src/tilesource.js index 8abe8cf0..bc936b3b 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -300,7 +300,7 @@ $.TileSource.prototype = { callback = function( data ){ if( typeof(data) === "string" ) { - data = $.parseXml( data ); + data = $.parseXml( data ); } var $TileSource = $.TileSource.determineType( _this, data, url ); if ( !$TileSource ) { From a70d082be3e9c3b961a217a712aca762f42ba653 Mon Sep 17 00:00:00 2001 From: gwills Date: Mon, 14 Oct 2013 10:59:20 +0100 Subject: [PATCH 4/5] Fix rotate on rectangular overalys Use size after rotate when positioning the overlay. Also removed check on this.scales - was there a reason these were not handled when rotating? If so we can add a option here maybe. --- src/overlay.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/overlay.js b/src/overlay.js index b828ac9e..f3df6cfb 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -211,13 +211,14 @@ // 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 && this.scales ) { - overlayCenter = new $.Point( size.x / 2, size.y / 2 ); - + 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 ); + position = position.plus( overlayCenter ).rotate( degrees, drawerCenter - ).minus( overlayCenter ); + ).minus( overlayCenterAfterRotate ); size = size.rotate( degrees, new $.Point( 0, 0 ) ); size = new $.Point( Math.abs( size.x ), Math.abs( size.y ) ); From 3777b53507dd770c2de0b50dd6217ca07248c156 Mon Sep 17 00:00:00 2001 From: gwills Date: Tue, 22 Oct 2013 13:54:32 +0100 Subject: [PATCH 5/5] 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 ) );