Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textEditor与导出问题 #328

Open
amourlemon opened this issue Jan 14, 2025 · 1 comment
Open

textEditor与导出问题 #328

amourlemon opened this issue Jan 14, 2025 · 1 comment

Comments

@amourlemon
Copy link

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

`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)`

@leaferjs
Copy link
Owner

leaferjs commented Jan 14, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants