From 954cbbdc46a6a2a8e380353d9c33bb0689047214 Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Mon, 9 Nov 2015 17:57:39 -0500 Subject: [PATCH] Rename this.image to this._image --- src/imagetilesource.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/imagetilesource.js b/src/imagetilesource.js index a0650be2..98f6c500 100644 --- a/src/imagetilesource.js +++ b/src/imagetilesource.js @@ -103,7 +103,7 @@ * @throws {Error} */ getImageInfo: function (url) { - var image = this.image = new Image(); + var image = this._image = new Image(); var _this = this; if (this.crossOriginPolicy) { @@ -228,32 +228,32 @@ */ _buildLevels: function () { var levels = [{ - url: this.image.src, - width: this.image.naturalWidth, - height: this.image.naturalHeight + url: this._image.src, + width: this._image.naturalWidth, + height: this._image.naturalHeight }]; if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) { // We don't need the image anymore. Allows it to be GC. - delete this.image; + delete this._image; return levels; } - var currentWidth = this.image.naturalWidth; - var currentHeight = this.image.naturalHeight; + var currentWidth = this._image.naturalWidth; + var currentHeight = this._image.naturalHeight; var bigCanvas = document.createElement("canvas"); var bigContext = bigCanvas.getContext("2d"); bigCanvas.width = currentWidth; bigCanvas.height = currentHeight; - bigContext.drawImage(this.image, 0, 0, currentWidth, currentHeight); + bigContext.drawImage(this._image, 0, 0, currentWidth, currentHeight); // We cache the context of the highest level because the browser // is a lot faster at downsampling something it already has // downsampled before. levels[0].context2D = bigContext; // We don't need the image anymore. Allows it to be GC. - delete this.image; + delete this._image; if ($.isCanvasTainted(bigCanvas)) { // If the canvas is tainted, we can't compute the pyramid.