From 4da45bd2a9763a3cb89e98c0c8f378eb7c8198c3 Mon Sep 17 00:00:00 2001 From: leaferjs Date: Thu, 26 Dec 2024 22:03:47 +0800 Subject: [PATCH] v1.2.1 --- src/app/config/type/app/custom.ts | 4 ++-- src/app/config/type/block.ts | 2 +- src/app/config/type/custom.ts | 4 ++-- src/performance/million.html | 2 +- src/plugin/editor/frame/index.ts | 2 +- src/plugin/editor/frame/origin.ts | 2 +- src/plugin/editor/frame/simple.ts | 2 +- src/property/custom/addAttr-datatype.ts | 8 ++++---- src/start/create.html | 2 +- src/worker/worker.js | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/app/config/type/app/custom.ts b/src/app/config/type/app/custom.ts index f10432e..8c0edb5 100644 --- a/src/app/config/type/app/custom.ts +++ b/src/app/config/type/app/custom.ts @@ -6,13 +6,13 @@ const app = new App({ tree: { type: 'custom' } // 给 tree 层添加自定义视口 // [!code hl] }) -// 自定义平移视图 // [!code hl:11] +// 需要自定义平移视图逻辑 // [!code hl:11] app.tree.on(MoveEvent.BEFORE_MOVE, (e: MoveEvent) => { const { x, y } = app.tree.getValidMove(e.moveX, e.moveY) app.tree.zoomLayer.move(x, y) }) -// 自定义缩放视图 +// 需要自定义缩放视图逻辑 app.tree.on(ZoomEvent.BEFORE_ZOOM, (e: ZoomEvent) => { const center = { x: e.x, y: e.y } app.tree.zoomLayer.scaleOfWorld(center, app.tree.getValidScale(e.scale)) diff --git a/src/app/config/type/block.ts b/src/app/config/type/block.ts index 49c8745..2f68e3c 100644 --- a/src/app/config/type/block.ts +++ b/src/app/config/type/block.ts @@ -6,7 +6,7 @@ const canvas = document.body.appendChild(document.createElement('canvas')) div.style.height = '600px' div.innerText = '请往下滑,会出现一个矩形' -const leafer = new Leafer({ view: canvas, height: 800 }) +const leafer = new Leafer({ view: canvas, height: 800 }) // 默认 block 类型,不要设置 const rect = new Rect({ x: 100, diff --git a/src/app/config/type/custom.ts b/src/app/config/type/custom.ts index 58c0140..14c9e93 100644 --- a/src/app/config/type/custom.ts +++ b/src/app/config/type/custom.ts @@ -6,13 +6,13 @@ const leafer = new Leafer({ type: 'custom' // 添加自定义视口 // [!code hl] }) -// 自定义平移视图 // [!code hl:11] +// 需要自定义平移视图逻辑 // [!code hl:11] leafer.on(MoveEvent.BEFORE_MOVE, (e: MoveEvent) => { const { x, y } = leafer.getValidMove(e.moveX, e.moveY) leafer.zoomLayer.move(x, y) }) -// 自定义缩放视图 +// 需要自定义缩放视图逻辑 leafer.on(ZoomEvent.BEFORE_ZOOM, (e: ZoomEvent) => { const center = { x: e.x, y: e.y } leafer.zoomLayer.scaleOfWorld(center, leafer.getValidScale(e.scale)) diff --git a/src/performance/million.html b/src/performance/million.html index 6e1aba6..9bf96c4 100644 --- a/src/performance/million.html +++ b/src/performance/million.html @@ -4,7 +4,7 @@ Million Rects | Leafer UI - + diff --git a/src/plugin/editor/frame/index.ts b/src/plugin/editor/frame/index.ts index eaeb4f6..f31f461 100644 --- a/src/plugin/editor/frame/index.ts +++ b/src/plugin/editor/frame/index.ts @@ -16,4 +16,4 @@ app.tree.add(Frame.one({ // 页面内容 ] }, 100, 100, 500, 600)) -app.sky.add(app.editor = new Editor()) // 添加图形编辑器,用于选中元素进行编辑操作 [!code hl] \ No newline at end of file +app.sky.add(app.editor = new Editor()) // 添加图形编辑器,用于选中元素进行编辑操作 // [!code hl] \ No newline at end of file diff --git a/src/plugin/editor/frame/origin.ts b/src/plugin/editor/frame/origin.ts index 3240f9c..ec54e25 100644 --- a/src/plugin/editor/frame/origin.ts +++ b/src/plugin/editor/frame/origin.ts @@ -14,4 +14,4 @@ app.tree.add(Frame.one({ // 页面内容 ] }, 100, 100, 500, 600)) -app.sky.add(app.editor = new Editor()) // 添加图形编辑器,用于选中元素进行编辑操作 [!code hl] \ No newline at end of file +app.sky.add(app.editor = new Editor()) // 添加图形编辑器,用于选中元素进行编辑操作 // [!code hl] \ No newline at end of file diff --git a/src/plugin/editor/frame/simple.ts b/src/plugin/editor/frame/simple.ts index ea21cad..e29e760 100644 --- a/src/plugin/editor/frame/simple.ts +++ b/src/plugin/editor/frame/simple.ts @@ -17,4 +17,4 @@ app.tree.add(Frame.one({ // 页面内容 ] }, 100, 100, 500, 600)) -// app.sky.add(app.editor = new Editor()) // 添加图形编辑器,用于选中元素进行编辑操作 [!code hl] +// app.sky.add(app.editor = new Editor()) // 添加图形编辑器,用于选中元素进行编辑操作 // [!code hl] diff --git a/src/property/custom/addAttr-datatype.ts b/src/property/custom/addAttr-datatype.ts index 57b8215..2c2f9de 100644 --- a/src/property/custom/addAttr-datatype.ts +++ b/src/property/custom/addAttr-datatype.ts @@ -2,7 +2,7 @@ import { Leafer, Text, dataType } from 'leafer-ui' const leafer = new Leafer({ view: window }) -Text.addAttr('version', '1.2.0', dataType) // [!code hl] +Text.addAttr('version', '1.2.1', dataType) // [!code hl] // default version @@ -10,10 +10,10 @@ const text = new Text({ text: 'Welcome to LeaferJS' }) leafer.add(text) -console.log((text as any).version) // 1.2.0 +console.log((text as any).version) // 1.2.1 // set version -const text2 = new Text({ version: '1.2.0' } as any) +const text2 = new Text({ version: '1.2.1' } as any) -console.log((text2 as any).version) // 1.2.0 \ No newline at end of file +console.log((text2 as any).version) // 1.2.1 \ No newline at end of file diff --git a/src/start/create.html b/src/start/create.html index 0da6225..5a11cbd 100644 --- a/src/start/create.html +++ b/src/start/create.html @@ -4,7 +4,7 @@ Demo | Leafer UI - +