small cleanup

This commit is contained in:
Tom 2022-12-06 16:52:48 -05:00
parent 757bf8690e
commit 256514bca6

View File

@ -709,8 +709,6 @@ $.Viewport.prototype = {
return this;
}
var referencePoint;
if(constraints){
this.panTo(center, false);
this.zoomTo(newZoom, null, false);
@ -725,7 +723,7 @@ $.Viewport.prototype = {
// this.zoomTo(newZoom, referencePoint, immediately);
} else {
var rotatedNewBounds = newBounds.rotate(-this.getRotation());
referencePoint = rotatedNewBounds.getTopLeft().times(newZoom)
var referencePoint = rotatedNewBounds.getTopLeft().times(newZoom)
.minus(oldBounds.getTopLeft().times(oldZoom))
.divide(newZoom - oldZoom);