Permalink
Browse files

Fix copying of SVGLayers

by making htmlIntrinsicSize exportable
  • Loading branch information...
nvh committed Aug 24, 2017
1 parent a9c2efe commit d526e514a06c2b6068781c415cf3700ec24ce465
Showing with 14 additions and 1 deletion.
  1. +1 −1 framer/Layer.coffee
  2. +13 −0 test/tests/SVGLayerTest.coffee
View
@@ -574,7 +574,7 @@ class exports.Layer extends BaseClass
@define "htmlIntrinsicSize",
importable: true
exportable: false
exportable: true
default: null
get: -> @_getPropertyValue "htmlIntrinsicSize"
set: (value) ->
@@ -9,3 +9,16 @@ describe "SVGLayer", ->
gradient: new Gradient
a._elementGradientSVG.innerHTML.should.not.be.equal b._elementGradientSVG.innerHTML
describe "copying", ->
it "should copy the html intrinsic size", ->
a = new SVGLayer
width: 24
html: "<?xml version=\"1.0\"?><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-toggle-right\"><rect x=\"1\" y=\"5\" width=\"22\" height=\"14\" rx=\"7\" ry=\"7\"><\/rect><circle cx=\"16\" cy=\"12\" r=\"3\"><\/circle><\/svg>",
htmlIntrinsicSize:
height: 24
width: 24
height: 24
b = a.copy()
a.htmlIntrinsicSize.should.eql b.htmlIntrinsicSize

0 comments on commit d526e51

Please sign in to comment.