mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 00:26:10 +03:00
Fixed test errors
This commit is contained in:
parent
7ba516b30a
commit
02a397638c
17
src/tile.js
17
src/tile.js
@ -367,16 +367,21 @@ $.Tile.prototype = {
|
|||||||
// changes as we are rendering the image
|
// changes as we are rendering the image
|
||||||
drawingHandler({context: context, tile: this, rendered: rendered});
|
drawingHandler({context: context, tile: this, rendered: rendered});
|
||||||
|
|
||||||
if (!this.sourceBounds) { // Just in case
|
var sourceWidth, sourceHeight;
|
||||||
this.sourceBounds = new $.Rect(0, 0, rendered.canvas.width, rendered.canvas.height);
|
if (this.sourceBounds) {
|
||||||
|
sourceWidth = Math.min(this.sourceBounds.width, rendered.canvas.width);
|
||||||
|
sourceHeight = Math.min(this.sourceBounds.height, rendered.canvas.height);
|
||||||
|
} else {
|
||||||
|
sourceWidth = rendered.canvas.width;
|
||||||
|
sourceHeight = rendered.canvas.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.drawImage(
|
context.drawImage(
|
||||||
rendered.canvas,
|
rendered.canvas,
|
||||||
this.sourceBounds.x,
|
0,
|
||||||
this.sourceBounds.y,
|
0,
|
||||||
this.sourceBounds.width,
|
sourceWidth,
|
||||||
this.sourceBounds.height,
|
sourceHeight,
|
||||||
position.x,
|
position.x,
|
||||||
position.y,
|
position.y,
|
||||||
size.x,
|
size.x,
|
||||||
|
@ -392,7 +392,7 @@ $.TileSource.prototype = {
|
|||||||
sy = Math.min( sy, dimensionsScaled.y - py );
|
sy = Math.min( sy, dimensionsScaled.y - py );
|
||||||
|
|
||||||
if (isSource) {
|
if (isSource) {
|
||||||
return new $.Rect(0, 0, Math.floor(sx), Math.floor(sy));
|
return new $.Rect(0, 0, sx, sy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new $.Rect( px * scale, py * scale, sx * scale, sy * scale );
|
return new $.Rect( px * scale, py * scale, sx * scale, sy * scale );
|
||||||
|
Loading…
Reference in New Issue
Block a user