Skip to content

Commit

Permalink
Add back screen scale functions
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbok committed Oct 27, 2014
1 parent 2e07617 commit a82c4fb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions framer/Layer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,26 @@ class exports.Layer extends BaseClass
# TODO: I don't think this is correct yet because you have to account
# for scale+origin and rotation+origin each step in the layer hierarchy.

screenOriginX = ->
if @_superOrParentLayer()
return @_superOrParentLayer().screenOriginX()
return @originX

screenOriginY = ->
if @_superOrParentLayer()
return @_superOrParentLayer().screenOriginY()
return @originY

screenScaleX: ->
if @_superOrParentLayer()
return @_superOrParentLayer().screenScaleX()
return @scale * @scaleX

screenScaleY: ->
if @_superOrParentLayer()
return @_superOrParentLayer().screenScaleY()
return @scale * @scaleY

screenScale: ->
scale = @scale
for superLayer in @superLayers()
Expand Down

0 comments on commit a82c4fb

Please sign in to comment.