Skip to content

"path" doesn't inherit "fill" attributte from groups #32

@walokr

Description

@walokr

I've some troubles with "path" nodes inside "g".
If "g" has a "fill", the "path" doesn't inherits the "fill" attribute.

I added these few lines between lines 65 and 66 of your code (you can test with this image: view-source:http://emojione.com/wp-content/uploads/assets/emojis/1f4a4.svg):

var groupFill =  elShape.getAttribute('fill');
		if (shapeName === "g" && groupFill) {
          var elShapeChildren = elShape.childNodes;
          for (i = 0, n = elShapeChildren.length; i < n; i++) {
            var elShapeChild = elShapeChildren[i];
            if (elShapeChild.nodeType === 1) {
				// add fill attribute
				elShapeChild.setAttribute('fill', groupFill);
            }
          }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions