Permalink
Browse files

Removing the SVGLayer form the parent tree

  • Loading branch information...
nvh committed Jan 24, 2018
1 parent 8df9369 commit 044f470bb295586b6fd3be7d35fcf03207d65f0b
Showing with 5 additions and 6 deletions.
  1. +1 −1 framer/Layer.coffee
  2. +4 −5 framer/SVGBaseLayer.coffee
View
@@ -57,7 +57,7 @@ layerProperty = (obj, name, cssProperty, fallback, validator, transformer, optio
if cssProperty isnt null
elementContainer = @
if cssProperty in @_stylesAppliedToParent
elementContainer = @parent
elementContainer = @_parent
@_parent._properties[name] = fallback
mainElement = elementContainer._element if includeMainElement or not targetElement
subElement = elementContainer[targetElement] if targetElement?
@@ -49,6 +49,7 @@ class exports.SVGBaseLayer extends Layer
exportable: false
importable: false
get: ->
return @_parent.parent if @_parent instanceof SVGLayer
@_parent or null
@define "html", get: -> @_element.outerHTML or ""
@@ -126,7 +127,9 @@ class exports.SVGBaseLayer extends Layer
@_pixelMultiplierOverride = 1
svgLayer = @_parent
while svgLayer? and not (svgLayer instanceof SVGLayer)
svgLayer = svgLayer.parent
svgLayer = svgLayer._parent
@_svgLayer = svgLayer
@_svg = @_svgLayer.svg
@_svgSize = svgLayer.size
pathProperties = ["fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-dasharray", "stroke-dashoffset", "name", "opacity"]
@@ -154,10 +157,6 @@ class exports.SVGBaseLayer extends Layer
@calculateSize()
super(options)
for parent in @ancestors()
if parent instanceof SVGLayer
@_svg = parent.svg
break
@resetViewbox()
for prop in ["frame", "stroke", "strokeWidth", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeDasharray", "strokeDashoffset", "rotation", "scale"]

0 comments on commit 044f470

Please sign in to comment.