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

various small svg fixes #5424

Merged
merged 6 commits into from
Dec 9, 2018
Merged

various small svg fixes #5424

merged 6 commits into from
Dec 9, 2018

Conversation

asturur
Copy link
Member

@asturur asturur commented Dec 9, 2018

close #5412
close #5414
close #5415
close #5417

fontSize = parentFontSize = parentAttributes.fontSize || fabric.Text.DEFAULT_SVG_FONT_SIZE;
if (ownAttributes['font-size']) {
fontSize = parseUnit(ownAttributes['font-size'], parentFontSize);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@rikkarv the idea here is that

  • parseUnit should be used always.
  • if the current fontSize is specified in EM ( i think is sort of legit ) we must reference the parent fontsize

Copy link
Member Author

Choose a reason for hiding this comment

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

ok this is not good needs additional tweaking as per the uploaded test.

Copy link

Choose a reason for hiding this comment

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

I have already tested your changes and

ownAttributes['font-size'] = fontSize = parseUnit(ownAttributes['font-size'], parentFontSize);

is really doing his job. Now i have fontSize as a number instead of a string and the following maths doesn't break.

Thank you very much for your effort

@asturur asturur merged commit aadfea0 into master Dec 9, 2018
@asturur asturur mentioned this pull request Dec 10, 2018
@asturur asturur deleted the svg-input-output-issues branch December 10, 2018 23:55
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
* various small svg fixes

* no debugger

* fontsize parsing fix - again

* added a visual test

* use min 9px

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