Skip to content

Commit 5453c2a

Browse files
author
Yan Heng
committed
feat: 滚动到内容功能
1 parent 506a27f commit 5453c2a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

main/src/view/canvas/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ onMounted(() => {
3333
<button @click="app.remove(...app.selected)">删除</button>
3434
<button @click="app.undo()">回退</button>
3535
<button @click="app.redo()">恢复</button>
36+
<button @click="app.zoomToContent()">快速定位</button>
3637
</div>
3738
<div class="tools">
3839
<button @click="app.setTool(selectTool())">选择🖱️</button>

packages/core/src/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ export class App extends BaseService<EventArgs> {
187187
this.mainLayer.draw();
188188
}
189189

190+
public zoomToContent(): void {
191+
console.log('滚动到内容');
192+
}
193+
190194
public toJSON(): string {
191195
return this.mainLayer.toJSON();
192196
}

0 commit comments

Comments
 (0)