fix cropping when viewer is rotated

This commit is contained in:
Tom 2023-03-06 14:29:39 -05:00
parent 7c81d068e6
commit a6e621b562

View File

@ -484,7 +484,8 @@ export class ThreeJSDrawer extends OpenSeadragon.DrawerBase{
if(item._croppingPolygons){ if(item._croppingPolygons){
let polygons = item._croppingPolygons.map(function (polygon) { let polygons = item._croppingPolygons.map(function (polygon) {
return polygon.map(function (coord) { return polygon.map(function (coord) {
let point = item.imageToViewportCoordinates(coord.x, coord.y, true); let point = item.imageToViewportCoordinates(coord.x, coord.y, true)
.rotate(_this.viewer.viewport.getRotation(true), _this.viewer.viewport.getCenter(true));
let clipPoint = _this.viewportCoordToDrawerCoord(point); let clipPoint = _this.viewportCoordToDrawerCoord(point);
return clipPoint; return clipPoint;
}); });