Permalink
Browse files

Add separate _updateKnob() function for width, height, scale, knobSiz…

…e changes on DragStart
  • Loading branch information...
Benjamin den Boer
Benjamin den Boer committed May 1, 2015
1 parent 0e755dc commit ab89ee4f213ce079f1964cd54e8e8ebfaedda0e4
Showing with 5 additions and 2 deletions.
  1. +5 −2 framer/Components/SliderComponent.coffee
@@ -59,7 +59,7 @@ class exports.SliderComponent extends Layer
@knob.on("change:x", @_updateFill)
@knob.on("change:x", @_updateValue)
@knob.on("change:size", @_updateFrame)
@knob.on("change:size", @_updateKnob)
@knob.on(Events.DragMove, @_updateFrame)
# On click/touch of the slider, update the value
@@ -78,6 +78,10 @@ class exports.SliderComponent extends Layer
_updateFill: =>
@fill.width = @knob.midX
_updateKnob: =>
@knob.midX = @fill.width
@knob.centerY()
_updateFrame: =>
@knob.draggable.constraints =
x: -@knob.width / 2
@@ -86,7 +90,6 @@ class exports.SliderComponent extends Layer
height: @height + @knob.height
@knob.centerY()
# @knob.midX = @fill.width
_setRadius: =>
radius = @borderRadius

0 comments on commit ab89ee4

Please sign in to comment.