Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
veasion committed Aug 2, 2024
1 parent e80ebe8 commit a021195
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions static/ppt2canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function Ppt2Canvas(_canvas, imageCrossOrigin) {

function calcTextHeight(obj) {
let totalTextHeight = 0
let wordWrap = obj.extInfo.property.textWordWrap
let wordWrap = obj.extInfo.property.textWordWrap ?? true
let textInsets = obj.extInfo.property.textInsets || [0, 0, 0, 0]
let wInset = textInsets[1] + textInsets[3]
for (let i = 0; i < obj.children.length; i++) {
Expand Down Expand Up @@ -212,7 +212,7 @@ function Ppt2Canvas(_canvas, imageCrossOrigin) {
let underlined = false
let totalTextWidth = 0
let anchor = textObj.extInfo.property.anchor
let wordWrap = textObj.extInfo.property.textWordWrap
let wordWrap = textObj.extInfo.property.textWordWrap ?? true
for (let i = 0; i < p.children.length; i++) {
let r = p.children[i]
let property = r.extInfo.property
Expand Down
4 changes: 2 additions & 2 deletions static/ppt2svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function Ppt2Svg(_svg, svgWidth, svgHeight) {
}
let property = obj.extInfo.property
let anchor = scaleAnchor(property.anchor)
let wordWrap = property.textWordWrap
let wordWrap = property.textWordWrap ?? true
let textInsets = property.textInsets || [0, 0, 0, 0]
let isVertical = property.textDirection && property.textDirection.indexOf('VERTICAL') > -1
let verticalAlignment = property.textVerticalAlignment
Expand Down Expand Up @@ -1319,7 +1319,7 @@ function Ppt2Svg(_svg, svgWidth, svgHeight) {
textarea.style.left = (rect.x + scrollX) + 'px'
textarea.style.top = (rect.y + scrollY) + 'px'
let isMultiLine = rect.height >= fontSize * 2
let textWordWrap = textObj.extInfo.property.textWordWrap
let textWordWrap = textObj.extInfo.property.textWordWrap ?? true
if (isMultiLine) {
textarea.style.width = rect.width + 'px'
textarea.style.height = (rect.height + fontSize * 2) + 'px'
Expand Down

0 comments on commit a021195

Please sign in to comment.