mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +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.sketchCanvas.height = sketchCanvasSize.y;
|
||||||
this.sketchContext = this.sketchCanvas.getContext( "2d" );
|
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
|
// If the viewport is not currently rotated, the sketchCanvas
|
||||||
// will have the same size as the main canvas. However, if
|
// will have the same size as the main canvas. However, if
|
||||||
// the viewport get rotated later on, we will need to resize it.
|
// the viewport get rotated later on, we will need to resize it.
|
||||||
if (this.viewport.getRotation() === 0) {
|
if (this.viewport.getRotation() === 0) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.viewer.addHandler('rotate', function resizeSketchCanvas() {
|
this.viewer.addOnceHandler('rotate', function resizeSketchCanvas() {
|
||||||
self.viewer.removeHandler('rotate', resizeSketchCanvas);
|
|
||||||
var sketchCanvasSize = self._calculateSketchCanvasSize();
|
var sketchCanvasSize = self._calculateSketchCanvasSize();
|
||||||
self.sketchCanvas.width = sketchCanvasSize.x;
|
self.sketchCanvas.width = sketchCanvasSize.x;
|
||||||
self.sketchCanvas.height = sketchCanvasSize.y;
|
self.sketchCanvas.height = sketchCanvasSize.y;
|
||||||
@ -617,7 +617,8 @@ $.Drawer.prototype = {
|
|||||||
// private
|
// private
|
||||||
_calculateSketchCanvasSize: function() {
|
_calculateSketchCanvasSize: function() {
|
||||||
var canvasSize = this._calculateCanvasSize();
|
var canvasSize = this._calculateCanvasSize();
|
||||||
if (this.viewport.getRotation() === 0) {
|
if (this.viewport.getRotation() === 0 &&
|
||||||
|
!this.viewer.world._hasRotatedItem()) {
|
||||||
return canvasSize;
|
return canvasSize;
|
||||||
}
|
}
|
||||||
// If the viewport is rotated, we need a larger sketch canvas in order
|
// If the viewport is rotated, we need a larger sketch canvas in order
|
||||||
|
@ -1670,7 +1670,7 @@ function drawTiles( tiledImage, lastDrawn ) {
|
|||||||
tiledImage._degrees,
|
tiledImage._degrees,
|
||||||
tiledImage.viewport.pixelFromPointNoRotate(
|
tiledImage.viewport.pixelFromPointNoRotate(
|
||||||
tiledImage._getRotationPoint(true), true),
|
tiledImage._getRotationPoint(true), true),
|
||||||
useSketch);
|
false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tiledImage._drawer.blendSketch({
|
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.
|
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||||
*/
|
*/
|
||||||
this.raiseEvent( 'remove-item', { item: item } );
|
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