Permalink
Browse files
Move resetViewBox to SVGBaseLayer
- Loading branch information...
Showing
with
7 additions
and
6 deletions.
-
+7
−0
framer/SVGBaseLayer.coffee
-
+0
−6
framer/SVGPath.coffee
|
@@ -82,9 +82,16 @@ class exports.SVGBaseLayer extends Layer |
|
|
|
@_svg = parent.svg |
|
|
|
break |
|
|
|
|
|
|
|
for prop in ["frame", "stroke", "strokeWidth", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeDasharray", "strokeDashoffset", "rotation"] |
|
|
|
@on "change:#{prop}", @resetViewbox |
|
|
|
|
|
|
|
@define "gradient", |
|
|
|
get: -> |
|
|
|
console.warn "The gradient property is currently not supported on shapes" |
|
|
|
return undefined |
|
|
|
set: (value) -> |
|
|
|
console.warn "The gradient property is currently not supported on shapes" |
|
|
|
|
|
|
|
resetViewbox: => |
|
|
|
@_svg.setAttribute("viewBox", "0,0,#{@width},#{@height}") |
|
|
|
@_svg.removeAttribute("viewBox") |
|
@@ -26,12 +26,6 @@ class exports.SVGPath extends SVGBaseLayer |
|
|
|
rect = @_element.getBoundingClientRect() |
|
|
|
@_width = rect.width |
|
|
|
@_height = rect.height |
|
|
|
for prop in ["frame", "stroke", "strokeWidth", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeDasharray", "strokeDashoffset"] |
|
|
|
@on "change:#{prop}", @resetViewbox |
|
|
|
|
|
|
|
resetViewbox: => |
|
|
|
@_svg.setAttribute("viewBox", "0,0,#{@width},#{@height}") |
|
|
|
@_svg.removeAttribute("viewBox") |
|
|
|
|
|
|
|
# Custom properties |
|
|
|
@define "fill", layerProperty(@, "fill", "fill", null, SVG.validFill, SVG.toFill) |
|
|
0 comments on commit
a909132