Skip to content

Commit

Permalink
Merge pull request gitbrent#633 from kevinresol/round-margin-values
Browse files Browse the repository at this point in the history
Round margin values
  • Loading branch information
gitbrent committed Dec 31, 2019
2 parents 8470e8e + 88dea2e commit f4c84c0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/gen-xml.ts
Expand Up @@ -438,15 +438,15 @@ function slideObjectToXml(slide: ISlide | ISlideLayout): string {

// Margin/Padding/Inset for textboxes
if (slideItemObj.options.margin && Array.isArray(slideItemObj.options.margin)) {
slideItemObj.options.bodyProp.lIns = slideItemObj.options.margin[0] * ONEPT || 0
slideItemObj.options.bodyProp.rIns = slideItemObj.options.margin[1] * ONEPT || 0
slideItemObj.options.bodyProp.bIns = slideItemObj.options.margin[2] * ONEPT || 0
slideItemObj.options.bodyProp.tIns = slideItemObj.options.margin[3] * ONEPT || 0
slideItemObj.options.bodyProp.lIns = Math.round(slideItemObj.options.margin[0] * ONEPT || 0)
slideItemObj.options.bodyProp.rIns = Math.round(slideItemObj.options.margin[1] * ONEPT || 0)
slideItemObj.options.bodyProp.bIns = Math.round(slideItemObj.options.margin[2] * ONEPT || 0)
slideItemObj.options.bodyProp.tIns = Math.round(slideItemObj.options.margin[3] * ONEPT || 0)
} else if (typeof slideItemObj.options.margin === 'number') {
slideItemObj.options.bodyProp.lIns = slideItemObj.options.margin * ONEPT
slideItemObj.options.bodyProp.rIns = slideItemObj.options.margin * ONEPT
slideItemObj.options.bodyProp.bIns = slideItemObj.options.margin * ONEPT
slideItemObj.options.bodyProp.tIns = slideItemObj.options.margin * ONEPT
slideItemObj.options.bodyProp.lIns = Math.round(slideItemObj.options.margin * ONEPT)
slideItemObj.options.bodyProp.rIns = Math.round(slideItemObj.options.margin * ONEPT)
slideItemObj.options.bodyProp.bIns = Math.round(slideItemObj.options.margin * ONEPT)
slideItemObj.options.bodyProp.tIns = Math.round(slideItemObj.options.margin * ONEPT)
}

if (shapeType === null) shapeType = getShapeInfo(null)
Expand Down

0 comments on commit f4c84c0

Please sign in to comment.