@hailin-zheng/editor-core 1.0.60 → 1.0.61
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/index-cjs.js +4 -3
- package/index-cjs.js.map +1 -1
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/med_editor/framework/element-define.d.ts +1 -0
- package/package.json +1 -1
package/index-cjs.js
CHANGED
@@ -1425,6 +1425,7 @@ class ViewOptions {
|
|
1425
1425
|
viewBackcolor = 'rgb(230,230,230)';
|
1426
1426
|
paraSymbolColor = 'rgb(128,128,128)';
|
1427
1427
|
dataGroupColor = 'rgb(0,80,179)';
|
1428
|
+
defaultLineHeight = 1.3;
|
1428
1429
|
//新增-留痕块文本颜色
|
1429
1430
|
trackInsColor = '#ff4d4f';
|
1430
1431
|
//删除-留痕块文本颜色
|
@@ -1762,7 +1763,7 @@ class ParagraphProps extends INotifyPropertyChanged {
|
|
1762
1763
|
if (this.hanging) {
|
1763
1764
|
props["hanging"] = this.hanging;
|
1764
1765
|
}
|
1765
|
-
if (this.lineHeight && this.lineHeight !==
|
1766
|
+
if (this.lineHeight && this.lineHeight !== viewOptions.defaultLineHeight) {
|
1766
1767
|
props["lineHeight"] = this.lineHeight;
|
1767
1768
|
}
|
1768
1769
|
if (this.textAlign && this.textAlign !== "left") {
|
@@ -3393,7 +3394,7 @@ class ParagraphFactory extends ElementFactory {
|
|
3393
3394
|
paraElement.props.hanging = props?.hanging ?? 0;
|
3394
3395
|
paraElement.props.textAlign = props?.textAlign ?? 'left';
|
3395
3396
|
paraElement.props.numberType = props?.numberType ?? -1;
|
3396
|
-
paraElement.props.lineHeight = props?.lineHeight ??
|
3397
|
+
paraElement.props.lineHeight = props?.lineHeight ?? this.options.defaultLineHeight;
|
3397
3398
|
paraElement.props.pageBreak = props?.pageBreak ?? false;
|
3398
3399
|
return paraElement;
|
3399
3400
|
}
|
@@ -10074,7 +10075,7 @@ class ElementMeasure {
|
|
10074
10075
|
const innerLineRect = innerLineRects[i];
|
10075
10076
|
innerLineRect.rect.x = this.getParaLineRectStartX(innerLineRects.length, i, paragraph, render, innerLineRect);
|
10076
10077
|
//限制最大行高
|
10077
|
-
const maxLineHeight = Math.floor(14 *
|
10078
|
+
const maxLineHeight = paragraph.props.lineHeight !== this.options.defaultLineHeight ? 100 : Math.floor(14 * 2);
|
10078
10079
|
//fillLineHeight填充行高
|
10079
10080
|
let fillLineHeight = Math.ceil(innerLineRect.rect.height * (paragraph.props.lineHeight - 1));
|
10080
10081
|
fillLineHeight = fillLineHeight > maxLineHeight ? maxLineHeight : fillLineHeight;
|