Skip to content

Commit

Permalink
feat: 增加draw.io示例里的图形种类
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Apr 8, 2023
1 parent 6cb9821 commit 2aba33b
Show file tree
Hide file tree
Showing 3 changed files with 699 additions and 342 deletions.
11 changes: 8 additions & 3 deletions examples/drawio_demo/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2955,9 +2955,14 @@ EditorUi.prototype.initCanvas = function()
var ty = graph.view.translate.y;
graph.view.setTranslate(dx, dy);

// 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);
//全屏,滚动条移至正中间
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);
}
this.autoTranslate = false;

return;
Expand Down
Loading

0 comments on commit 2aba33b

Please sign in to comment.