Fixes zoomToRect function

Fixes zoomToRect function
development
David Benson 2013-01-16 06:40:54 +00:00
parent 62d531e944
commit 2918d0725e
1 changed files with 3 additions and 2 deletions

View File

@ -6742,14 +6742,15 @@ mxGraph.prototype.zoomToRect = function(rect)
}
var scale = this.container.clientWidth / rect.width;
var newScale = this.view.scale * scale;
if (!mxUtils.hasScrollbars(this.container))
{
this.view.scaleAndTranslate(scale, -rect.x, -rect.y);
this.view.scaleAndTranslate(newScale, (this.view.translate.x - rect.x / this.view.scale), (this.view.translate.y - rect.y / this.view.scale));
}
else
{
this.view.setScale(scale);
this.view.setScale(newScale);
this.container.scrollLeft = Math.round(rect.x * scale);
this.container.scrollTop = Math.round(rect.y * scale);
}