From 8eaba61b1712fe85ce793ee3315934c78e81e088 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Thu, 7 Aug 2014 16:11:31 +0200 Subject: [PATCH] Update parser.js Add support to catch attributes from symbol nodes. This is a quick hack. To have full support symbol should managed as defs and then copied as g, without display attribute. But before adding tons of code, let's just make it work. --- src/parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.js b/src/parser.js index 9b1ce184..6d6b6413 100644 --- a/src/parser.js +++ b/src/parser.js @@ -700,8 +700,8 @@ var value, parentAttributes = { }; - // if there's a parent container (`g` node), parse its attributes recursively upwards - if (element.parentNode && /^[g|a]$/i.test(element.parentNode.nodeName)) { + // if there's a parent container (`g` or `a` or `symbol` node), parse its attributes recursively upwards + if (element.parentNode && /^symbol|[g|a]$/i.test(element.parentNode.nodeName)) { parentAttributes = fabric.parseAttributes(element.parentNode, attributes); }