Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Set SVG property in BaseLayer
- Loading branch information
Showing
with
5 additions
and
12 deletions.
-
+5
−0
framer/SVGBaseLayer.coffee
-
+0
−7
framer/SVGGroup.coffee
-
+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" |
|
|
|
@@ -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) -> |
|
|
|
@@ -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 |
|
|
|
|
|