Skip to content

Commit

Permalink
fix fontsize parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Sep 22, 2018
1 parent 7dc02a8 commit 0a9466a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,6 @@
if (element.parentNode && fabric.svgValidParentsRegEx.test(element.parentNode.nodeName)) {
parentAttributes = fabric.parseAttributes(element.parentNode, attributes, svgUid);
}
fontSize = (parentAttributes && parentAttributes.fontSize ) ||
element.getAttribute('font-size') || fabric.Text.DEFAULT_SVG_FONT_SIZE;

var ownAttributes = attributes.reduce(function(memo, attr) {
value = element.getAttribute(attr);
Expand All @@ -841,6 +839,9 @@
ownAttributes = extend(ownAttributes,
extend(getGlobalStylesForElement(element, svgUid), fabric.parseStyleAttribute(element)));

fontSize = (parentAttributes && parentAttributes.fontSize ) ||
ownAttributes['font-size'] || fabric.Text.DEFAULT_SVG_FONT_SIZE;

var normalizedAttr, normalizedValue, normalizedStyle = {};
for (var attr in ownAttributes) {
normalizedAttr = normalizeAttr(attr);
Expand Down

0 comments on commit 0a9466a

Please sign in to comment.