Permalink
Browse files

Fixed padding for devicePixelRatio

  • Loading branch information...
nvh committed Jul 11, 2017
1 parent b1cb2ca commit 4ce455dfdf89c920be71962dfd7d9145bf49a5bc
Showing with 10 additions and 1 deletion.
  1. +1 −1 framer/TextLayer.coffee
  2. +9 −0 test/tests/TextLayerTest.coffee
View
@@ -522,7 +522,7 @@ class exports.TextLayer extends Layer
# Top, Right, Bottom, Left
@style.padding =
"#{@_padding.top}px #{@_padding.right}px #{@_padding.bottom}px #{@_padding.left}px"
"#{@_padding.top * @context.pixelMultiplier}px #{@_padding.right * @context.pixelMultiplier}px #{@_padding.bottom * @context.pixelMultiplier}px #{@_padding.left * @context.pixelMultiplier}px"
renderText: =>
return if @__constructor
@@ -273,6 +273,15 @@ describe "TextLayer", ->
text.padding.left.should.equal 0
text.padding.right.should.equal 0
it "should take the devicePixelRatio into account", ->
device = new DeviceComponent()
device.deviceType = "apple-iphone-7-black"
device.context.run ->
layerA = new TextLayer
size: 100
padding: 10
layerA.style.padding.should.equal "20px"
describe "webfonts", ->
it "sets the weight if the font property is set", ->
l = new TextLayer

0 comments on commit 4ce455d

Please sign in to comment.