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

[Feature]: 画布背景的设置方法 #2087

Closed
Niko-Mata opened this issue Feb 27, 2025 · 2 comments
Closed

[Feature]: 画布背景的设置方法 #2087

Niko-Mata opened this issue Feb 27, 2025 · 2 comments

Comments

@Niko-Mata
Copy link

背景&目的

背景:我的项目中存在主题切换功能,当我进行切换时需要对画布背景色进行重设,但我发现setTheme并不包含对background的设置,且background只在创建实例时可以进行配置,这就需要我重新去创建新的画布实例并重新添加一些画布上之前已经添加过的内容,十分麻烦。
目的:在setTheme中添加一个设置background的方法,或单独封装一个设置setBackground的方法。

@ZivvW
Copy link
Contributor

ZivvW commented Feb 27, 2025

可以用 lf.graphModel.updateBackgroundOptions

@DymoneLewis
Copy link
Collaborator

同上面朋友所说,目前已经有这样的方法了
参数类型,见👇🏻
{
// 背景图片地址
backgroundImage?: string
// CSS background-repeat 属性
backgroundRepeat?:
| 'repeat'
| 'repeat-x'
| 'repeat-y'
| 'no-repeat'
| 'initial'
| 'inherit'
[key: string]: any
}

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

No branches or pull requests

3 participants