Skip to content

Commit

Permalink
Make circular progress component independent from SVGLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Treub committed Jun 28, 2017
1 parent a23f50d commit 16e23b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions 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

Expand All @@ -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

Expand Down

0 comments on commit 16e23b2

Please sign in to comment.