Permalink
Browse files

Fix min and max scale

  • Loading branch information...
Koen Bok
Koen Bok committed Feb 3, 2016
1 parent 4795a1b commit 7f04ad8a0a1acc749428d684fa37da9901629915
Showing with 8 additions and 1 deletion.
  1. +8 −1 framer/LayerPinchable.coffee
@@ -88,7 +88,14 @@ class exports.LayerPinchable extends BaseClass
if @scale
@_scaleStart ?= @layer.scale
scale = (((event.scale - 1) * @scaleFactor) + 1) * @_scaleStart
scale = Utils.clamp(scale, @minScale, @maxScale) if (@minScale and @maxScale)
if @minScale and @maxScale
scale = Utils.clamp(scale, @minScale, @maxScale)
else if @minScale
scale = Utils.clamp(scale, @minScale, 1000000)
else if @maxScale
scale = Utils.clamp(scale, 0.00001, @maxScale)
scale = Utils.nearestIncrement(scale, @scaleIncrements) if @scaleIncrements
@layer.scale = scale
@emit(Events.Scale, event)

0 comments on commit 7f04ad8

Please sign in to comment.