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

fix: 修复默认字体设置不生效 #1307

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Conversation

zengyue
Copy link
Member

@zengyue zengyue commented Dec 7, 2021

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Description of change

if (type === 'text' && canvas && canvas.get('fontFamily')) {
item._attrs.attrs.fontFamily = item._attrs.attrs.fontFamily || canvas.get('fontFamily');
if (type === 'text' && canvas && canvas.get('fontFamily') && !item._attrs.attrs.fontFamily) {
item.attr('fontFamily', canvas.get('fontFamily'));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要通过 attr 方法设置字体,不然 item.font 不会更新

Copy link
Member

@ACERY1 ACERY1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@ACERY1 ACERY1 merged commit 901850a into v4.0.x Dec 7, 2021
@ACERY1 ACERY1 deleted the fix-theme-fontFamily branch December 7, 2021 11:42
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

Successfully merging this pull request may close these issues.

None yet

2 participants