Skip to content

Commit

Permalink
Add back support for scale parameter and make default scale 1
Browse files Browse the repository at this point in the history
  • Loading branch information
altert committed Aug 27, 2021
1 parent e54dcec commit fca333d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions openseadragon-fabricjs-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
this._fabricjsOverlayInfo._scale = options.scale; // arbitrary scale for created fabric canvas
}
else {
this._fabricjsOverlayInfo._scale = 1000;
this._fabricjsOverlayInfo._scale = 1;
}

return this._fabricjsOverlayInfo;
Expand Down Expand Up @@ -178,9 +178,8 @@
let viewportZoom = this._viewer.viewport.getZoom(true);
this._fabricCanvas.setWidth(this._containerWidth);
this._fabricCanvas.setHeight(this._containerHeight);
// let zoom = this._viewer.viewport._containerInnerSize.x * viewportZoom / this._scale;
// this._fabricCanvas.setZoom(zoom);
this._fabricCanvas.setZoom(viewportZoom);
let zoom = this._viewer.viewport._containerInnerSize.x * viewportZoom / this._scale;
this._fabricCanvas.setZoom(zoom);
let viewportWindowPoint = this._viewer.viewport.viewportToWindowCoordinates(origin);
let x = Math.round(viewportWindowPoint.x);
let y = Math.round(viewportWindowPoint.y);
Expand Down

0 comments on commit fca333d

Please sign in to comment.