Permalink
Browse files

Setting strokeLength and strokeFraction defaults to null

  • Loading branch information...
nvh committed Jan 15, 2018
1 parent a909132 commit a0030c01aad37915bbe2010a3e2ba9ca5d204414
Showing with 2 additions and 2 deletions.
  1. +2 −2 framer/SVGPath.coffee
View
@@ -37,12 +37,12 @@ class exports.SVGPath extends SVGBaseLayer
@define "strokeOpacity", layerProperty(@, "strokeOpacity", "strokeOpacity", null, _.isNumber)
@define "strokeDasharray", layerProperty(@, "strokeDasharray", "strokeDasharray", [], _.isArray, dashArrayTransform)
@define "strokeDashoffset", layerProperty(@, "strokeDashoffset", "strokeDashoffset", null, _.isNumber, parseFloat)
@define "strokeLength", layerProperty @, "strokeLength", null, null, _.isNumber, null, {}, (path, value) ->
@define "strokeLength", layerProperty @, "strokeLength", null, undefined, _.isNumber, null, {}, (path, value) ->
path._properties.strokeFraction = value / path.length
if _.isEmpty path.strokeDasharray
path.strokeDasharray = [path.length]
path.strokeDashoffset = path.length - value
@define "strokeFraction", layerProperty @, "strokeFraction", null, null, _.isNumber, null, {}, (path, value) ->
@define "strokeFraction", layerProperty @, "strokeFraction", null, undefined, _.isNumber, null, {}, (path, value) ->
path.strokeLength = path.length * value
@define "length", get: -> @_length

0 comments on commit a0030c0

Please sign in to comment.