Permalink
Browse files

Fixing SVG "use" tag from producing an error; we need to use querySel…

…ector instead of getElementById because seemingly the latter fails when the queried for element is not staged yet.
  • Loading branch information...
edwinvanrijkom committed Jan 18, 2018
1 parent c40be67 commit 37e97cb4bc932195ee7ca4d04a9da328a92c61f5
Showing with 3 additions and 2 deletions.
  1. +3 −2 framer/SVGPath.coffee
View
@@ -16,6 +16,7 @@ dashArrayTransform = (value) ->
class exports.SVGPath extends SVGBaseLayer
constructor: (path, options) ->
if path instanceof SVGPath
path = path.element
@@ -25,8 +26,8 @@ class exports.SVGPath extends SVGBaseLayer
if path instanceof SVGPathElement
@_path = path
else if path instanceof SVGUseElement
link = path.getAttribute("xlink:href").replace("#", '')
@_path = @_svg.getElementById(link)
link = path.getAttribute("xlink:href")
@_path = @_svg.querySelector(link)
@_length = @_path.getTotalLength()
# Custom properties

0 comments on commit 37e97cb

Please sign in to comment.