From 286ba36bf3a040efc6bd54148722e93ed3002ed3 Mon Sep 17 00:00:00 2001 From: leesei Date: Fri, 6 Jan 2017 11:30:09 +0800 Subject: [PATCH 1/4] fix param for `update()` Changes to be committed: modified: src/overlay.js --- src/overlay.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/overlay.js b/src/overlay.js index 25cc50d2..7ad7a646 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -41,6 +41,7 @@ * compatibility. * @member OverlayPlacement * @memberof OpenSeadragon + * @see OpenSeadragon.Placement * @static * @readonly * @type {Object} @@ -400,7 +401,7 @@ * @param {OpenSeadragon.Point|OpenSeadragon.Rect|Object} location * If an object is specified, the options are the same than the constructor * except for the element which can not be changed. - * @param {OpenSeadragon.Placement} position + * @param {OpenSeadragon.Placement} placement */ update: function(location, placement) { var options = $.isPlainObject(location) ? location : { From 41b8956df6757caee93ed2f47d776667dac2983d Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Sat, 7 Jan 2017 17:38:38 +0100 Subject: [PATCH 2/4] Fix version object not filled. Fix #1024 --- .vscode/settings.json | 9 --------- Gruntfile.js | 5 +++-- package.json | 4 ++-- test/modules/basic.js | 8 ++++++++ test/test.html | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 752fa89f..686e7452 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,5 @@ // Place your settings in this file to overwrite default and user settings. { - // Controls the font size. - "editor.fontSize": 14, - // The number of spaces a tab is equal to. "editor.tabSize": 4, @@ -15,12 +12,6 @@ // Columns at which to show vertical rulers "editor.rulers": [80], - // Controls after how many characters the editor will wrap to the next line. Setting this to 0 turns on viewport width wrapping - "editor.wrappingColumn": 0, - - // Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'. - "editor.wrappingIndent": "none", - // The default character set encoding to use when reading and writing files. "files.encoding": "utf8", diff --git a/Gruntfile.js b/Gruntfile.js index d1e86ae2..a48002b1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -123,10 +123,11 @@ module.exports = function(grunt) { join_vars: false }, sourceMap: true, - sourceMapName: 'build/openseadragon/openseadragon.min.js.map' + sourceMapName: 'build/openseadragon/openseadragon.min.js.map', + sourceMapIn: 'build/openseadragon/openseadragon.js.map' }, openseadragon: { - src: sources, + src: distribution, dest: minified } }, diff --git a/package.json b/package.json index 19bd4d21..a1fe2301 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,10 @@ "grunt": "^0.4.5", "grunt-contrib-clean": "^0.7.0", "grunt-contrib-compress": "^0.13.0", - "grunt-contrib-concat": "^0.5.1", + "grunt-contrib-concat": "^1.0.1", "grunt-contrib-connect": "^0.11.2", "grunt-contrib-jshint": "^0.11.0", - "grunt-contrib-uglify": "^0.11.0", + "grunt-contrib-uglify": "^2.0.0", "grunt-contrib-watch": "^0.6.1", "grunt-git-describe": "^2.3.2", "grunt-qunit-istanbul": "^0.6.0", diff --git a/test/modules/basic.js b/test/modules/basic.js index 4d787ab4..7dc2a9ef 100644 --- a/test/modules/basic.js +++ b/test/modules/basic.js @@ -423,4 +423,12 @@ }); } ); + + test('version object', function() { + equal(typeof OpenSeadragon.version.versionStr, "string", "versionStr should be a string"); + ok(OpenSeadragon.version.major >= 0, "major should be a positive number"); + ok(OpenSeadragon.version.minor >= 0, "minor should be a positive number"); + ok(OpenSeadragon.version.revision >= 0, "revision should be a positive number"); + }); + })(); diff --git a/test/test.html b/test/test.html index 74495ff6..985dcb3e 100644 --- a/test/test.html +++ b/test/test.html @@ -14,7 +14,7 @@ - + From a23a709fb17c60615bbceb5fafea4bf198130998 Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Sat, 7 Jan 2017 19:56:37 +0100 Subject: [PATCH 3/4] Disable tile edge smoothing when only one tile is drawn. Fix #956 --- src/tiledimage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index bca7c823..21497a76 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1702,8 +1702,11 @@ function drawTiles( tiledImage, lastDrawn ) { var zoom = tiledImage.viewport.getZoom(true); var imageZoom = tiledImage.viewportToImageZoom(zoom); // TODO: support tile edge smoothing with tiled image rotation. - if (imageZoom > tiledImage.smoothTileEdgesMinZoom && !tiledImage.iOSDevice && - tiledImage.getRotation() === 0 && $.supportsCanvas) { + if (lastDrawn.length > 1 && + imageZoom > tiledImage.smoothTileEdgesMinZoom && + !tiledImage.iOSDevice && + tiledImage.getRotation() === 0 && + $.supportsCanvas) { // When zoomed in a lot (>100%) the tile edges are visible. // So we have to composite them at ~100% and scale them up together. // Note: Disabled on iOS devices per default as it causes a native crash From 43bd0e972f1269e03d9d3d99320f7ca15708f968 Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Sun, 8 Jan 2017 11:13:32 +0100 Subject: [PATCH 4/4] Fix sketch canvas not resizing properly. Fix #973 --- src/drawer.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/drawer.js b/src/drawer.js index 02a036aa..2355a828 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -328,7 +328,11 @@ $.Drawer.prototype = { // the viewport get rotated later on, we will need to resize it. if (this.viewport.getRotation() === 0) { var self = this; - this.viewer.addOnceHandler('rotate', function resizeSketchCanvas() { + this.viewer.addHandler('rotate', function resizeSketchCanvas() { + if (self.viewport.getRotation() === 0) { + return; + } + self.viewer.removeHandler('rotate', resizeSketchCanvas); var sketchCanvasSize = self._calculateSketchCanvasSize(); self.sketchCanvas.width = sketchCanvasSize.x; self.sketchCanvas.height = sketchCanvasSize.y; @@ -422,8 +426,8 @@ $.Drawer.prototype = { this.context.globalCompositeOperation = compositeOperation; } if (bounds) { - // Internet Explorer and Microsoft Edge throw IndexSizeError - // when you call context.drawImage with negative x or y + // Internet Explorer and Microsoft Edge throw IndexSizeError + // when you call context.drawImage with negative x or y // or width or height greater than the canvas width or height respectively if (bounds.x < 0) { bounds.width += bounds.x; @@ -439,7 +443,7 @@ $.Drawer.prototype = { if (bounds.height > this.canvas.height) { bounds.height = this.canvas.height; } - + this.context.drawImage( this.sketchCanvas, bounds.x,