From efc9098ce4eb2f442b5405982a0c06f03e1d4202 Mon Sep 17 00:00:00 2001 From: Mei-Hui Su Date: Tue, 19 Jan 2016 11:49:04 -0800 Subject: [PATCH] Make setting of globalCompositeOperation optional in drawer.js --- src/drawer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drawer.js b/src/drawer.js index abb432f3..d3867806 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -370,6 +370,7 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{ * @param {Float} [scale=1] The scale at which tiles were drawn on the sketch. Default is 1. * Use scale to draw at a lower scale and then enlarge onto the main canvas. * @param OpenSeadragon.Point} [translate] A translation vector that was used to draw the tiles + * @param {String} [options.compositeOperation='source-over'] - How the image is composited onto other images; see compositeOperation in {@link OpenSeadragon.Options} for possible values. * @returns {undefined} */ blendSketch: function(opacity, scale, translate, compositeOperation) { @@ -383,7 +384,9 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{ this.context.save(); this.context.globalAlpha = opacity; - this.context.globalCompositeOperation = compositeOperation; + if (compositeOperation !== undefined) { + this.context.globalCompositeOperation = compositeOperation; + } this.context.drawImage( this.sketchCanvas, position.x,