leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

textEditor与导出问题

Open amourlemon opened this issue 11 months ago • 1 comments

导出时,文字在编辑状态时,文字会全部消失

`import { Leafer, Group, Rect, DropEvent, DragEvent, Text, App } from 'leafer-ui' import '@leafer-in/editor' // 导入图形编辑器插件 import '@leafer-in/text-editor' const app = new App({ view: window, editor: {} // 会自动创建 editor实例、tree层、sky层 })

const leafer = app.tree

const text = Text.one({ text: 'Action is the proper fruit of knowledge.', editable: true, fill: '#FFE04B', fontSize: 16, }, 100, 100, 100)

const rect = new Rect({ width: 100, height: 100, editable: true, fill: [ { type: 'image', url: 'https://cdn.pixabay.com/photo/2022/08/19/13/31/woman-7396948_1280.jpg', mode: 'stretch', opacity: 1 }] })

leafer.add(rect) leafer.add(text)

setTimeout(() => { leafer.export('screenshot.png') }, 10000)import { Leafer, Group, Rect, DropEvent, DragEvent, Text, App } from 'leafer-ui' import '@leafer-in/editor' // 导入图形编辑器插件 import '@leafer-in/text-editor' const app = new App({ view: window, editor: {} // 会自动创建 editor实例、tree层、sky层 })

const leafer = app.tree

const text = Text.one({ text: 'Action is the proper fruit of knowledge.', editable: true, fill: '#FFE04B', fontSize: 16, }, 100, 100, 100)

const rect = new Rect({ width: 100, height: 100, editable: true, fill: [ { type: 'image', url: 'https://cdn.pixabay.com/photo/2022/08/19/13/31/woman-7396948_1280.jpg', mode: 'stretch', opacity: 1 }] })

leafer.add(rect) leafer.add(text)

setTimeout(() => { leafer.export('screenshot.png') }, 10000)`

amourlemon avatar Jan 14 '25 06:01 amourlemon

谢谢反馈,编辑状态确实隐藏了原始文本(显示的是一个dom文本),下个版本可以优化一下导出~

leaferjs avatar Jan 14 '25 11:01 leaferjs