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}
|
||||
*/
|
||||
getScaleForEdgeSmoothing: function() {
|
||||
if (!this.cacheImageRecord) {
|
||||
var context;
|
||||
if (this.cacheImageRecord) {
|
||||
context = this.cacheImageRecord.getRenderedContext();
|
||||
} else if (this.context2D) {
|
||||
context = this.context2D;
|
||||
} else {
|
||||
$.console.warn(
|
||||
'[Tile.drawCanvas] attempting to get tile scale %s when tile\'s not cached',
|
||||
this.toString());
|
||||
return 1;
|
||||
}
|
||||
|
||||
var rendered = this.cacheImageRecord.getRenderedContext();
|
||||
return rendered.canvas.width / this.size.times($.pixelDensityRatio).x;
|
||||
return context.canvas.width / (this.size.x * $.pixelDensityRatio);
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user