Skip to content

Commit

Permalink
Merge pull request #11091 from Snuffleupagus/textLayer-expandTextDivs…
Browse files Browse the repository at this point in the history
…-valid-padding

[TextLayer] Only handle positive padding values in `expandTextDivs`
  • Loading branch information
timvandermeij authored Aug 23, 2019
2 parents 490deb1 + 932fcac commit d1ef08e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/display/text_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,21 +643,21 @@ var renderTextLayer = (function renderTextLayerClosure() {
if (divProps.angle !== 0) {
transform = `rotate(${divProps.angle}deg) ${transform}`;
}
if (divProps.paddingLeft !== 0) {
if (divProps.paddingLeft > 0) {
padding +=
` padding-left: ${divProps.paddingLeft / divProps.scale}px;`;
transform +=
` translateX(${-divProps.paddingLeft / divProps.scale}px)`;
}
if (divProps.paddingTop !== 0) {
if (divProps.paddingTop > 0) {
padding += ` padding-top: ${divProps.paddingTop}px;`;
transform += ` translateY(${-divProps.paddingTop}px)`;
}
if (divProps.paddingRight !== 0) {
if (divProps.paddingRight > 0) {
padding +=
` padding-right: ${divProps.paddingRight / divProps.scale}px;`;
}
if (divProps.paddingBottom !== 0) {
if (divProps.paddingBottom > 0) {
padding += ` padding-bottom: ${divProps.paddingBottom}px;`;
}

Expand Down

0 comments on commit d1ef08e

Please sign in to comment.