Fix center properly ...

This commit is contained in:
Paulo Veiga
2011-08-28 10:58:41 -03:00
parent 26759bd437
commit c2521f0f9f
3 changed files with 18 additions and 9 deletions

View File

@@ -99,16 +99,24 @@ mindplot.Workspace = new Class({
var coordHeight = zoom * this._screenHeight;
workspace.setCoordSize(coordWidth, coordHeight);
// View port coords ...
if (this._viewPort) {
this._viewPort.width = this._viewPort.width * zoom;
this._viewPort.height = this._viewPort.height * zoom;
}
// Center topic....
var coordOriginX;
var coordOriginY;
if (center && this._viewPort) {
coordOriginX = -(this._viewPort.width / 2);
coordOriginY = -(this._viewPort.height / 2);
} else if (center) {
coordOriginX = -(coordWidth / 2);
coordOriginY = -(coordHeight / 2);
if (center) {
if (this._viewPort) {
coordOriginX = -(this._viewPort.width / 2);
coordOriginY = -(this._viewPort.height / 2);
} else {
coordOriginX = -(coordWidth / 2);
coordOriginY = -(coordHeight / 2);
}
} else {
var coordOrigin = workspace.getCoordOrigin();
coordOriginX = coordOrigin.x;