We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e8984e9 + 2d39d1d commit 94b858dCopy full SHA for 94b858d
plugin-packages/rich-text/src/rich-text-layout.ts
@@ -68,12 +68,12 @@ export class RichTextLayout implements BaseLayout {
68
this.height = size ? size[1] : 100;
69
70
this.wrapEnabled = wrapEnabled;
71
- // 兜底,避免 0/负数/NaN/Infinity
72
- const safeMaxW = Number.isFinite(maxTextWidth) ? maxTextWidth : 0;
73
- const safeMaxH = Number.isFinite(maxTextHeight) ? maxTextHeight : 0;
74
75
- this.maxTextWidth = Math.max(1, safeMaxW);
76
- this.maxTextHeight = Math.max(1, safeMaxH);
+ // TODO: 统一富文本和图层 size 单位,这边先临时做个转换
+ const scaleFactor = 50;
+
+ this.maxTextWidth = maxTextWidth * scaleFactor;
+ this.maxTextHeight = maxTextHeight * scaleFactor;
77
this.sizeMode = sizeMode;
78
}
79
0 commit comments