mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +03:00
Fix getScaleForEdgeSmoothing with image tile source.
This commit is contained in:
parent
3775a877e2
commit
f8de9b33b0
11
src/tile.js
11
src/tile.js
@ -336,15 +336,18 @@ $.Tile.prototype = {
|
|||||||
* @return {Float}
|
* @return {Float}
|
||||||
*/
|
*/
|
||||||
getScaleForEdgeSmoothing: function() {
|
getScaleForEdgeSmoothing: function() {
|
||||||
if (!this.cacheImageRecord) {
|
var context;
|
||||||
|
if (this.cacheImageRecord) {
|
||||||
|
context = this.cacheImageRecord.getRenderedContext();
|
||||||
|
} else if (this.context2D) {
|
||||||
|
context = this.context2D;
|
||||||
|
} else {
|
||||||
$.console.warn(
|
$.console.warn(
|
||||||
'[Tile.drawCanvas] attempting to get tile scale %s when tile\'s not cached',
|
'[Tile.drawCanvas] attempting to get tile scale %s when tile\'s not cached',
|
||||||
this.toString());
|
this.toString());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
return context.canvas.width / (this.size.x * $.pixelDensityRatio);
|
||||||
var rendered = this.cacheImageRecord.getRenderedContext();
|
|
||||||
return rendered.canvas.width / this.size.times($.pixelDensityRatio).x;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user