Skip to content

Commit

Permalink
Setting strokeLength and strokeFraction defaults to null
Browse files Browse the repository at this point in the history
  • Loading branch information
nvh committed Jan 15, 2018
1 parent a909132 commit a0030c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framer/SVGPath.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0030c0

Please sign in to comment.