Permalink
Browse files

Set SVG property in BaseLayer

  • Loading branch information...
nvh committed Jan 15, 2018
1 parent 3413e12 commit 07ac6677721b879d3185f15ef1ac6eb8faec5d82
Showing with 5 additions and 12 deletions.
  1. +5 −0 framer/SVGBaseLayer.coffee
  2. +0 −7 framer/SVGGroup.coffee
  3. +0 −5 framer/SVGPath.coffee
@@ -77,6 +77,11 @@ class exports.SVGBaseLayer extends Layer
super(options)
for parent in @ancestors()
if parent instanceof SVGLayer
@_svg = parent.svg
break
@define "gradient",
get: ->
console.warn "The gradient property is currently not supported on shapes"
View
@@ -9,16 +9,9 @@ class SVGGroup extends SVGBaseLayer
constructor: (group, options) ->
options.element = group
super(options)
{children, targets} = SVG.constructSVGElements(@, @_element.childNodes, SVGPath, SVGGroup)
@_children = children
@elements = targets
for parent in @ancestors()
if parent instanceof SVGLayer
@_svg = parent.svg
break
SVG.updateGradientSVG(@)
@defineGroupProxyProp = (propertyName, validator, transformer) ->
View
@@ -26,11 +26,6 @@ class exports.SVGPath extends SVGBaseLayer
rect = @_element.getBoundingClientRect()
@_width = rect.width
@_height = rect.height
for parent in @ancestors()
if parent instanceof SVGLayer
@_svg = parent.svg
break
for prop in ["frame", "stroke", "strokeWidth", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeDasharray", "strokeDashoffset"]
@on "change:#{prop}", @resetViewbox

0 comments on commit 07ac667

Please sign in to comment.