Skip to content

Commit

Permalink
fix: 修复形状/文本垂直对齐方向
Browse files Browse the repository at this point in the history
  • Loading branch information
pipipi-pikachu committed Nov 26, 2023
1 parent cf1c89f commit 3b90b25
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.umd.js.map

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions src/pptxtojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,11 @@ function shapeArc(cX, cY, rX, rY, stAng, endAng, isClose) {

function getVerticalAlign(node, slideLayoutSpNode, slideMasterSpNode) {
let anchor = getTextByPathList(node, ['p:txBody', 'a:bodyPr', 'attrs', 'anchor'])
if (anchor) {
if (!anchor) {
anchor = getTextByPathList(slideLayoutSpNode, ['p:txBody', 'a:bodyPr', 'attrs', 'anchor'])
if (anchor) {
if (!anchor) {
anchor = getTextByPathList(slideMasterSpNode, ['p:txBody', 'a:bodyPr', 'attrs', 'anchor'])
if (anchor) {
anchor = 't'
}
if (!anchor) anchor = 't'
}
}
return (anchor === 'ctr') ? 'mid' : ((anchor === 'b') ? 'down' : 'up')
Expand Down
Binary file modified test.pptx
Binary file not shown.

0 comments on commit 3b90b25

Please sign in to comment.