Permalink
Browse files

Make circular progress component independent from SVGLayer

  • Loading branch information...
jonastreub committed Jun 27, 2017
1 parent a23f50d commit 16e23b244804e1080a9c34344e9c108c85d93a55
Showing with 12 additions and 4 deletions.
  1. +12 −4 framer/Components/CircularProgressComponent.coffee
@@ -1,10 +1,15 @@
{SVGLayer} = require "../SVGLayer"
{Layer} = require "../Layer"
class exports.CircularProgressComponent extends SVGLayer
class exports.CircularProgressComponent extends Layer
constructor: (options={}) ->
super
@svg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
@svg.setAttribute("width", "100%")
@svg.setAttribute("height", "100%")
@svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink")
@backgroundColor = null
@rotation = -90
@@ -19,10 +24,13 @@ class exports.CircularProgressComponent extends SVGLayer
@railsColor = Color.grey(.2)
@progressColor = Color.grey(1)
@svg.appendChild(@rails)
@svg.appendChild(@circle)
@_element.appendChild(@svg)
addShape: (type) ->
shape = document.createElementNS("http://www.w3.org/2000/svg", "circle")
@svg.appendChild(shape)
return shape
@define "radius",
get: -> @width / 2 - @strokeWidth / 2

0 comments on commit 16e23b2

Please sign in to comment.