mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-19 17:21:50 +03:00
Merge pull request #922 from avandecreme/master
Fix getScaleForEdgeSmoothing with image tile source.
This commit is contained in:
commit
1b39167780
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…
x
Reference in New Issue
Block a user