mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Merge pull request #1041 from zakharov-aa/master
IE8 fix for tileSources type: 'image'
This commit is contained in:
commit
6878bc8771
@ -114,8 +114,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.addEvent(image, 'load', function () {
|
$.addEvent(image, 'load', function () {
|
||||||
_this.width = image.naturalWidth;
|
/* IE8 fix since it has no naturalWidth and naturalHeight */
|
||||||
_this.height = image.naturalHeight;
|
_this.width = Object.prototype.hasOwnProperty.call(image, 'naturalWidth') ? image.naturalWidth : image.width;
|
||||||
|
_this.height = Object.prototype.hasOwnProperty.call(image, 'naturalHeight') ? image.naturalHeight : image.height;
|
||||||
_this.aspectRatio = _this.width / _this.height;
|
_this.aspectRatio = _this.width / _this.height;
|
||||||
_this.dimensions = new $.Point(_this.width, _this.height);
|
_this.dimensions = new $.Point(_this.width, _this.height);
|
||||||
_this._tileWidth = _this.width;
|
_this._tileWidth = _this.width;
|
||||||
@ -202,8 +203,9 @@
|
|||||||
_buildLevels: function () {
|
_buildLevels: function () {
|
||||||
var levels = [{
|
var levels = [{
|
||||||
url: this._image.src,
|
url: this._image.src,
|
||||||
width: this._image.naturalWidth,
|
/* IE8 fix since it has no naturalWidth and naturalHeight */
|
||||||
height: this._image.naturalHeight
|
width: Object.prototype.hasOwnProperty.call(this._image, 'naturalWidth') ? this._image.naturalWidth : this._image.width,
|
||||||
|
height: Object.prototype.hasOwnProperty.call(this._image, 'naturalHeight') ? this._image.naturalHeight : this._image.height
|
||||||
}];
|
}];
|
||||||
|
|
||||||
if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) {
|
if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) {
|
||||||
@ -212,8 +214,10 @@
|
|||||||
return levels;
|
return levels;
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentWidth = this._image.naturalWidth;
|
/* IE8 fix since it has no naturalWidth and naturalHeight */
|
||||||
var currentHeight = this._image.naturalHeight;
|
var currentWidth = Object.prototype.hasOwnProperty.call(this._image, 'naturalWidth') ? this._image.naturalWidth : this._image.width;
|
||||||
|
var currentHeight = Object.prototype.hasOwnProperty.call(this._image, 'naturalHeight') ? this._image.naturalHeight : this._image.height;
|
||||||
|
|
||||||
|
|
||||||
var bigCanvas = document.createElement("canvas");
|
var bigCanvas = document.createElement("canvas");
|
||||||
var bigContext = bigCanvas.getContext("2d");
|
var bigContext = bigCanvas.getContext("2d");
|
||||||
|
Loading…
Reference in New Issue
Block a user