mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 22:26:10 +03:00
fix closure for croppingPolygons in drawTile
This commit is contained in:
parent
0335f3f4ab
commit
5829a9e892
@ -1940,14 +1940,15 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this._croppingPolygons) {
|
if (this._croppingPolygons) {
|
||||||
|
var self = this;
|
||||||
this._drawer.saveContext(useSketch);
|
this._drawer.saveContext(useSketch);
|
||||||
try {
|
try {
|
||||||
var polygons = this._croppingPolygons.map(function (polygon) {
|
var polygons = this._croppingPolygons.map(function (polygon) {
|
||||||
return polygon.map(function (coord) {
|
return polygon.map(function (coord) {
|
||||||
var point = this
|
var point = self
|
||||||
.imageToViewportCoordinates(coord.x, coord.y, true)
|
.imageToViewportCoordinates(coord.x, coord.y, true)
|
||||||
.rotate(-this.getRotation(true), this._getRotationPoint(true));
|
.rotate(-self.getRotation(true), self._getRotationPoint(true));
|
||||||
var clipPoint = this._drawer.viewportCoordToDrawerCoord(point);
|
var clipPoint = self._drawer.viewportCoordToDrawerCoord(point);
|
||||||
if (sketchScale) {
|
if (sketchScale) {
|
||||||
clipPoint = clipPoint.times(sketchScale);
|
clipPoint = clipPoint.times(sketchScale);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user