mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 08:36:10 +03:00
Fix tests.
This commit is contained in:
parent
43bb0d7741
commit
3e56092445
11
src/tile.js
11
src/tile.js
@ -351,10 +351,13 @@ $.Tile.prototype = /** @lends OpenSeadragon.Tile.prototype */{
|
|||||||
* @return {OpenSeadragon.Point}
|
* @return {OpenSeadragon.Point}
|
||||||
*/
|
*/
|
||||||
getTranslationForEdgeSmoothing: function(scale, canvasSize, sketchCanvasSize) {
|
getTranslationForEdgeSmoothing: function(scale, canvasSize, sketchCanvasSize) {
|
||||||
var sketchCanvasDelta = new $.Point(
|
// The translation vector must have positive values, otherwise the image goes a bit off
|
||||||
Math.ceil((sketchCanvasSize.x - canvasSize.x) / 2),
|
// the sketch canvas to the top and left and we must use negative coordinates to repaint it
|
||||||
Math.ceil((sketchCanvasSize.y - canvasSize.y) / 2));
|
// to the main canvas. In that case, some browsers throw:
|
||||||
return sketchCanvasDelta.minus(
|
// INDEX_SIZE_ERR: DOM Exception 1: Index or size was negative, or greater than the allowed value.
|
||||||
|
var x = Math.max(1, Math.ceil((sketchCanvasSize.x - canvasSize.x) / 2));
|
||||||
|
var y = Math.max(1, Math.ceil((sketchCanvasSize.y - canvasSize.y) / 2));
|
||||||
|
return new $.Point(x, y).minus(
|
||||||
this.position
|
this.position
|
||||||
.times($.pixelDensityRatio)
|
.times($.pixelDensityRatio)
|
||||||
.times(scale || 1)
|
.times(scale || 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user