pptxtojson 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/shape.js +6 -3
package/package.json
CHANGED
package/src/shape.js
CHANGED
|
@@ -33,11 +33,14 @@ export function shapeArc(cX, cY, rX, rY, stAng, endAng, isClose) {
|
|
|
33
33
|
|
|
34
34
|
export function getCustomShapePath(custShapType, w, h) {
|
|
35
35
|
const pathLstNode = getTextByPathList(custShapType, ['a:pathLst'])
|
|
36
|
-
|
|
36
|
+
let pathNodes = getTextByPathList(pathLstNode, ['a:path'])
|
|
37
|
+
|
|
38
|
+
if (Array.isArray(pathNodes)) pathNodes = pathNodes.pop()
|
|
39
|
+
|
|
37
40
|
const maxX = parseInt(pathNodes['attrs']['w'])
|
|
38
41
|
const maxY = parseInt(pathNodes['attrs']['h'])
|
|
39
|
-
const cX = (1 / maxX) * w
|
|
40
|
-
const cY = (1 / maxY) * h
|
|
42
|
+
const cX = maxX === 0 ? 0 : (1 / maxX) * w
|
|
43
|
+
const cY = maxY === 0 ? 0 : (1 / maxY) * h
|
|
41
44
|
let d = ''
|
|
42
45
|
|
|
43
46
|
let moveToNode = getTextByPathList(pathNodes, ['a:moveTo'])
|