Permalink
Browse files

copy borderradius and remove copying of styles for now

  • Loading branch information...
J.P.P Treub
J.P.P Treub committed Nov 2, 2015
1 parent 3b32854 commit 0e4d9bbcc0eb521fbf40bf9f4a06ebebd0f45833
Showing with 14 additions and 7 deletions.
  1. +4 −2 framer/Layer.coffee
  2. +10 −5 test/tests/LayerTest.coffee
@@ -191,6 +191,8 @@ class exports.Layer extends BaseClass
# Border radius compatibility
@define "borderRadius",
importable: true
exportable: true
default: 0
get: ->
@_properties["borderRadius"]
@@ -207,7 +209,8 @@ class exports.Layer extends BaseClass
# And, because it should be cornerRadius, we alias it here
@define "cornerRadius",
importable: yes
importable: false
exportable: false
# exportable: no
get: -> @borderRadius
set: (value) -> @borderRadius = value
@@ -509,7 +512,6 @@ class exports.Layer extends BaseClass
copySingle: ->
copy = new @constructor(@props)
copy.style = @style
return copy
##############################################################
@@ -905,21 +905,26 @@ describe "Layer", ->
X = 100
Y = 200
IMAGE = '../static/test.png'
BORDERRADIUS = 20
layer = new Layer
x:X
y:Y
image:IMAGE
layer.borderRadius = BORDERRADIUS
layer.x.should.eql X
layer.y.should.eql Y
layer.image.should.eql IMAGE
layer.borderRadius.should.eql BORDERRADIUS
copy = layer.copy()
copy.x.should.eql X
copy.y.should.eql Y
copy.image.should.eql IMAGE
copy.borderRadius.should.eql BORDERRADIUS
it "copied Layer should have defaults", ->
@@ -929,13 +934,13 @@ describe "Layer", ->
copy.width.should.equal 100
copy.height.should.equal 100
it "copied layer should copy styles", ->
# it "copied layer should copy styles", ->
layer = new Layer
layer.style.backgroundColor = "yellow"
# layer = new Layer
# layer.style.backgroundColor = "yellow"
layer2 = layer.copy()
layer2.style.backgroundColor.should.equal "yellow"
# layer2 = layer.copy()
# layer2.style.backgroundColor.should.equal "yellow"

0 comments on commit 0e4d9bb

Please sign in to comment.