Skip to content

如果在拖动改变Group等容器W和H时,如何让内容等比缩放,现在文本不会缩放 #822

@ZhengNan-coder

Description

@ZhengNan-coder

// #图形编辑器 [手动选择元素]
import { App, Rect,Group,Text } from 'leafer-ui'
import '@leafer-in/editor' // 导入图形编辑器插件
import '@leafer-in/viewport' // 导入视口插件 (可选)

const app = new App({
view: window,
editor: {}
})
const g=new Group({ editable: true, "hitChildren": false,})
const text=new Text({
text:"测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本",
fontSize:24,
fill: 'red', cornerRadius: [20, 0, 0, 20] ,x:100, y:100,width:200},
)

g.add(Rect.one({ editable: true, fill: '#FEB027', cornerRadius: [20, 0, 0, 20] }, 100, 100))
g.add(Rect.one({ editable: true, fill: '#FFE04B', cornerRadius: [0, 20, 20, 0] }, 300, 100))
g.add(text)

app.tree.add(g)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions