Skip to content

Commit

Permalink
fix: 删除多余逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Apr 10, 2023
1 parent 1f30506 commit 668993b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions examples/drawio_demo/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2955,14 +2955,9 @@ EditorUi.prototype.initCanvas = function()
var ty = graph.view.translate.y;
graph.view.setTranslate(dx, dy);

//全屏,滚动条移至正中间
if (parent.document.querySelector('#tdialog') && parent.document.querySelector('#tdialog').clientWidth === parent.document.body.clientWidth) {
graph.container.scrollLeft = document.body.clientWidth / 2;
} else {
// LATER: Fix rounding errors for small zoom
graph.container.scrollLeft += Math.round((dx - tx) * graph.view.scale);
graph.container.scrollTop += Math.round((dy - ty) * graph.view.scale);
}
// LATER: Fix rounding errors for small zoom
graph.container.scrollLeft += Math.round((dx - tx) * graph.view.scale);
graph.container.scrollTop += Math.round((dy - ty) * graph.view.scale);
this.autoTranslate = false;

return;
Expand Down

0 comments on commit 668993b

Please sign in to comment.