Skip to content

Commit 4b90a17

Browse files
图片尺寸在画布自动缩放功能 (#467)
* fix(plugin): 优化resize功能 * feat(plugin): remove event observer
1 parent 64e3fb6 commit 4b90a17

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/core/plugin/WorkspacePlugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class WorkspacePlugin implements IPluginTempl {
100100
if (this.canvas.clearHistory) {
101101
this.canvas.clearHistory();
102102
}
103+
this.auto();
103104
}
104105

105106
// 返回workspace对象
@@ -144,6 +145,7 @@ class WorkspacePlugin implements IPluginTempl {
144145
this.workspace.set('width', width);
145146
this.workspace.set('height', height);
146147
this.editor.emit('sizeChange', this.workspace.width, this.workspace.height);
148+
this.auto();
147149
}
148150

149151
setZoomAuto(scale: number, cb?: (left?: number, top?: number) => void) {

0 commit comments

Comments
 (0)