|
|
@@ -1185,7 +1185,8 @@ export default () => {
|
|
|
defaultFontName: theme.value.fontName,
|
|
|
defaultColor: theme.value.fontColor,
|
|
|
content: convertFontSizePtToPx(el.content, ratio),
|
|
|
- lineHeight: 1,
|
|
|
+ style: getStyle(convertFontSizePtToPx(el.content, ratio)),
|
|
|
+ lineHeight: 1.5,
|
|
|
outline: {
|
|
|
color: el.borderColor,
|
|
|
width: +(el.borderWidth * ratio).toFixed(2),
|
|
|
@@ -1245,7 +1246,7 @@ export default () => {
|
|
|
range: [[0, 0], [100, 100]],
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
+/*
|
|
|
// 如果 src 是 base64,触发上传
|
|
|
if (el.src && typeof el.src === 'string' && el.src.startsWith('data:')) {
|
|
|
const uploadTask = (async () => {
|
|
|
@@ -1260,7 +1261,7 @@ export default () => {
|
|
|
})();
|
|
|
uploadTasks.push(uploadTask);
|
|
|
}
|
|
|
-
|
|
|
+*/
|
|
|
slide.elements.push(element);
|
|
|
}
|
|
|
else if (el.type === 'math') {
|
|
|
@@ -1275,7 +1276,7 @@ export default () => {
|
|
|
fixedRatio: true,
|
|
|
rotate: 0,
|
|
|
}
|
|
|
-
|
|
|
+ /*
|
|
|
// 如果 src 是 base64,触发上传
|
|
|
if (el.src && typeof el.src === 'string' && el.src.startsWith('data:')) {
|
|
|
const uploadTask = (async () => {
|
|
|
@@ -1290,6 +1291,7 @@ export default () => {
|
|
|
})();
|
|
|
uploadTasks.push(uploadTask);
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
slide.elements.push(element)
|
|
|
|
|
|
@@ -1414,7 +1416,7 @@ export default () => {
|
|
|
},
|
|
|
text: {
|
|
|
content: convertFontSizePtToPx(el.content, ratio),
|
|
|
- style: getStyle(el.content),
|
|
|
+ style: getStyle(convertFontSizePtToPx(el.content, ratio)),
|
|
|
defaultFontName: theme.value.fontName,
|
|
|
defaultColor: theme.value.fontColor,
|
|
|
align: vAlignMap[el.vAlign] || 'middle',
|
|
|
@@ -1434,12 +1436,13 @@ export default () => {
|
|
|
|
|
|
if (shape) {
|
|
|
element.path = shape.path;
|
|
|
+ //const { maxX, maxY } = getSvgPathRange(el.path);
|
|
|
element.viewBox = shape.viewBox;
|
|
|
-
|
|
|
+ //element.viewBox = [originWidth || maxX, originHeight || maxY];
|
|
|
if (shape.pathFormula) {
|
|
|
element.pathFormula = shape.pathFormula;
|
|
|
element.viewBox = [el.width, el.height];
|
|
|
-
|
|
|
+ //element.viewBox = [poriginWidth || originWidth || maxX, poriginHeight || originHeight || maxY];
|
|
|
const pathFormula = SHAPE_PATH_FORMULAS[shape.pathFormula];
|
|
|
if ('editable' in pathFormula && pathFormula.editable) {
|
|
|
element.path = pathFormula.formula(el.width, el.height, pathFormula.defaultValue);
|
|
|
@@ -1448,12 +1451,14 @@ export default () => {
|
|
|
element.path = pathFormula.formula(el.width, el.height);
|
|
|
}
|
|
|
}
|
|
|
- } else if (el.path && el.path.indexOf('NaN') === -1) {
|
|
|
+ }
|
|
|
+ else if (el.path && el.path.indexOf('NaN') === -1) {
|
|
|
const { maxX, maxY } = getSvgPathRange(el.path);
|
|
|
element.path = el.path;
|
|
|
-
|
|
|
- element.viewBox = [poriginWidth|| originWidth || maxX, poriginHeight || originHeight || maxY];
|
|
|
- //element.viewBox = [originWidth, originHeight];
|
|
|
+ element.viewBox = poriginWidth? [maxX, maxY]: [originWidth, originHeight];
|
|
|
+ //element.viewBox = [originWidth || maxX, originHeight || maxY];
|
|
|
+ //element.viewBox = originWidth? [(originWidth/(poriginWidth||1)), (originHeight/(poriginHeight||1))] : [maxX, maxY];
|
|
|
+ //element.viewBox = [poriginWidth || maxX, poriginHeight || maxY];
|
|
|
}
|
|
|
|
|
|
if (el.shapType === 'custom') {
|
|
|
@@ -1466,7 +1471,10 @@ export default () => {
|
|
|
element.path = el.path!;
|
|
|
}
|
|
|
const { maxX, maxY } = getSvgPathRange(element.path);
|
|
|
- element.viewBox = [poriginWidth||maxX || originWidth, poriginHeight||maxY || originHeight];
|
|
|
+ element.viewBox = [maxX, maxY];
|
|
|
+ //element.viewBox = [originWidth || maxX, originHeight || maxY];
|
|
|
+ //element.viewBox = [poriginWidth || originWidth || maxX, poriginHeight || originHeight || maxY];
|
|
|
+ //element.viewBox = [poriginWidth || originWidth || maxX, poriginHeight || originHeight || maxY];
|
|
|
//element.viewBox = [Math.max(maxX, originWidth), Math.max(maxY, originHeight)];
|
|
|
//element.viewBox = [originWidth, originHeight];
|
|
|
}
|
|
|
@@ -1663,7 +1671,7 @@ export default () => {
|
|
|
if (el.isFlipV) elements = flipGroupElements(elements, 'x');
|
|
|
|
|
|
// 递归解析子元素(注意:子元素的上传任务会加入同一个 uploadTasks 数组)
|
|
|
- await parseElements(elements, pelements || el);
|
|
|
+ await parseElements(elements, el);
|
|
|
}
|
|
|
|
|
|
// ---------- 图表组合(SmartArt)----------
|
|
|
@@ -1673,7 +1681,7 @@ export default () => {
|
|
|
left: _el.left + originLeft,
|
|
|
top: _el.top + originTop,
|
|
|
}));
|
|
|
- await parseElements(elements);
|
|
|
+ await parseElements(elements, el);
|
|
|
}
|
|
|
}
|
|
|
};
|