@flexem/fc-gui 3.0.0-alpha.143 → 3.0.0-alpha.144
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/bundles/@flexem/fc-gui.umd.js +4 -3
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/shared/text/text-element.js +1 -1
- package/elements/view-operation/view-operation.element.js +3 -2
- package/package.json +1 -1
|
@@ -35836,7 +35836,7 @@ class text_element_TextElementModal {
|
|
|
35836
35836
|
const minFontSize = 12;
|
|
35837
35837
|
lineHeight = parseInt(font.fontSize, 10) + 5;
|
|
35838
35838
|
fontString += font.fontSize + '/' + lineHeight.toString() + 'px ' + font.fontFamily;
|
|
35839
|
-
textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};`;
|
|
35839
|
+
textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};text-align: ${textAlign};`;
|
|
35840
35840
|
if (font.isUnderline) {
|
|
35841
35841
|
textDiv.style.textDecoration = 'underline';
|
|
35842
35842
|
}
|
|
@@ -40543,10 +40543,11 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40543
40543
|
initElement() {
|
|
40544
40544
|
const width = this.model.size.width;
|
|
40545
40545
|
const height = this.model.size.height;
|
|
40546
|
+
// 在 initGraph 之前移除模板原有的 SVG <text>(改用 foreignObject 渲染,支持换行居中)
|
|
40547
|
+
// 必须在 initGraph 前执行,否则会误删图形状态内部后续添加的文字节点
|
|
40548
|
+
this.$element.find('text').remove();
|
|
40546
40549
|
this.initGraph(width, height);
|
|
40547
40550
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
|
|
40548
|
-
// 移除模板中原有的 SVG <text> 元素,改用 TextElementModal(foreignObject)渲染,支持换行
|
|
40549
|
-
this.$element.find('text').last().remove();
|
|
40550
40551
|
const font = Object.assign(Object.assign({}, this.model.label.font), { fontFamily: this.model.label.font.fontFamily || 'msyh' });
|
|
40551
40552
|
this.textElementModal = new text_element_TextElementModal(this.getDisplayText(), font, width, height);
|
|
40552
40553
|
this.$element.append(this.textElementModal.Element);
|