diff --git a/javascript/src/js/view/mxGraph.js b/javascript/src/js/view/mxGraph.js index 8fc2a74df..1ee58d63b 100644 --- a/javascript/src/js/view/mxGraph.js +++ b/javascript/src/js/view/mxGraph.js @@ -8005,8 +8005,8 @@ mxGraph.prototype.center = function(horizontal, vertical, cx, cy) if (!hasScrollbars) { - this.view.setTranslate((horizontal) ? Math.floor(t.x - bounds.x * s + dx * cx / s) : t.x, - (vertical) ? Math.floor(t.y - bounds.y * s + dy * cy / s) : t.y); + this.view.setTranslate((horizontal) ? Math.floor(t.x - bounds.x / s + dx * cx / s) : t.x, + (vertical) ? Math.floor(t.y - bounds.y / s + dy * cy / s) : t.y); } else {