mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Partialy fix edge smoothing.
This commit is contained in:
parent
fbcf78c894
commit
2821c8f67b
@ -323,13 +323,13 @@ $.Drawer.prototype = {
|
||||
this.sketchCanvas.height = sketchCanvasSize.y;
|
||||
this.sketchContext = this.sketchCanvas.getContext( "2d" );
|
||||
|
||||
// FIXME: should check if any tiled image get rotated as well.
|
||||
// If the viewport is not currently rotated, the sketchCanvas
|
||||
// will have the same size as the main canvas. However, if
|
||||
// the viewport get rotated later on, we will need to resize it.
|
||||
if (this.viewport.getRotation() === 0) {
|
||||
var self = this;
|
||||
this.viewer.addHandler('rotate', function resizeSketchCanvas() {
|
||||
self.viewer.removeHandler('rotate', resizeSketchCanvas);
|
||||
this.viewer.addOnceHandler('rotate', function resizeSketchCanvas() {
|
||||
var sketchCanvasSize = self._calculateSketchCanvasSize();
|
||||
self.sketchCanvas.width = sketchCanvasSize.x;
|
||||
self.sketchCanvas.height = sketchCanvasSize.y;
|
||||
@ -617,7 +617,8 @@ $.Drawer.prototype = {
|
||||
// private
|
||||
_calculateSketchCanvasSize: function() {
|
||||
var canvasSize = this._calculateCanvasSize();
|
||||
if (this.viewport.getRotation() === 0) {
|
||||
if (this.viewport.getRotation() === 0 &&
|
||||
!this.viewer.world._hasRotatedItem()) {
|
||||
return canvasSize;
|
||||
}
|
||||
// If the viewport is rotated, we need a larger sketch canvas in order
|
||||
|
@ -1670,7 +1670,7 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
tiledImage._degrees,
|
||||
tiledImage.viewport.pixelFromPointNoRotate(
|
||||
tiledImage._getRotationPoint(true), true),
|
||||
useSketch);
|
||||
false);
|
||||
}
|
||||
}
|
||||
tiledImage._drawer.blendSketch({
|
||||
|
10
src/world.js
10
src/world.js
@ -436,6 +436,16 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
|
||||
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
*/
|
||||
this.raiseEvent( 'remove-item', { item: item } );
|
||||
},
|
||||
|
||||
// private
|
||||
_hasRotatedItem: function() {
|
||||
for (var i = 0; i < this._items.length; i++) {
|
||||
if (this._items[i].getRotation() !== 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user