diff --git a/mindplot/src/main/javascript/Workspace.js b/mindplot/src/main/javascript/Workspace.js index 9b62c74d..f5b5d252 100644 --- a/mindplot/src/main/javascript/Workspace.js +++ b/mindplot/src/main/javascript/Workspace.js @@ -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; diff --git a/web2d/src/main/javascript/peer/svg/WorkspacePeer.js b/web2d/src/main/javascript/peer/svg/WorkspacePeer.js index ab4bc146..1b1b4acf 100644 --- a/web2d/src/main/javascript/peer/svg/WorkspacePeer.js +++ b/web2d/src/main/javascript/peer/svg/WorkspacePeer.js @@ -23,6 +23,8 @@ web2d.peer.svg.WorkspacePeer = function(element) web2d.peer.svg.ElementPeer.call(this, svgElement); this._native.setAttribute("focusable", "true"); this._native.setAttribute("id", "workspace"); + this._native.setAttribute("preserveAspectRatio", "true"); + }; objects.extend(web2d.peer.svg.WorkspacePeer, web2d.peer.svg.ElementPeer); diff --git a/wise-doc/src/main/webapp/js/editor.js b/wise-doc/src/main/webapp/js/editor.js index 9280ca4c..361be456 100644 --- a/wise-doc/src/main/webapp/js/editor.js +++ b/wise-doc/src/main/webapp/js/editor.js @@ -196,7 +196,6 @@ function buildMindmapDesigner() { // core.Monitor.setInstance(monitor); var container = $('mindplot'); -// container.setStyles(); container.setStyles({ height: parseInt(screen.height), @@ -205,8 +204,8 @@ function buildMindmapDesigner() { designer = new mindplot.MindmapDesigner(editorProperties, container); designer.setViewPort({ - height: parseInt(window.innerHeight - 150), - width: parseInt(window.innerWidth - 200) + height: parseInt(window.innerHeight-112), // Footer and Header + width: parseInt(window.innerWidth) }); if (mindplot.collaboration.CollaborationManager.getInstance().isCollaborationFrameworkAvailable()) {