mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Merge pull request #1429 from openseadragon/ig-square
Fixed issue with square tile code on IE
This commit is contained in:
commit
ceb828dd06
17
src/tile.js
17
src/tile.js
@ -367,16 +367,21 @@ $.Tile.prototype = {
|
||||
// changes as we are rendering the image
|
||||
drawingHandler({context: context, tile: this, rendered: rendered});
|
||||
|
||||
if (!this.sourceBounds) { // Just in case
|
||||
this.sourceBounds = new $.Rect(0, 0, rendered.canvas.width, rendered.canvas.height);
|
||||
var sourceWidth, sourceHeight;
|
||||
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(
|
||||
rendered.canvas,
|
||||
this.sourceBounds.x,
|
||||
this.sourceBounds.y,
|
||||
this.sourceBounds.width,
|
||||
this.sourceBounds.height,
|
||||
0,
|
||||
0,
|
||||
sourceWidth,
|
||||
sourceHeight,
|
||||
position.x,
|
||||
position.y,
|
||||
size.x,
|
||||
|
@ -392,9 +392,7 @@ $.TileSource.prototype = {
|
||||
sy = Math.min( sy, dimensionsScaled.y - py );
|
||||
|
||||
if (isSource) {
|
||||
scale = 1;
|
||||
px = 0;
|
||||
py = 0;
|
||||
return new $.Rect(0, 0, sx, sy);
|
||||
}
|
||||
|
||||
return new $.Rect( px * scale, py * scale, sx * scale, sy * scale );
|
||||
|
Loading…
Reference in New Issue
Block a user