@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.
@@ -69,7 +69,7 @@ export class TextElementModal {
69
69
  const minFontSize = 12;
70
70
  lineHeight = parseInt(font.fontSize, 10) + 5;
71
71
  fontString += font.fontSize + '/' + lineHeight.toString() + 'px ' + font.fontFamily;
72
- textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};`;
72
+ textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};text-align: ${textAlign};`;
73
73
  if (font.isUnderline) {
74
74
  textDiv.style.textDecoration = 'underline';
75
75
  }
@@ -32,10 +32,11 @@ export class ViewOperationElement extends ConditionalEnableElement {
32
32
  initElement() {
33
33
  const width = this.model.size.width;
34
34
  const height = this.model.size.height;
35
+ // 在 initGraph 之前移除模板原有的 SVG <text>(改用 foreignObject 渲染,支持换行居中)
36
+ // 必须在 initGraph 前执行,否则会误删图形状态内部后续添加的文字节点
37
+ this.$element.find('text').remove();
35
38
  this.initGraph(width, height);
36
39
  this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
37
- // 移除模板中原有的 SVG <text> 元素,改用 TextElementModal(foreignObject)渲染,支持换行
38
- this.$element.find('text').last().remove();
39
40
  const font = Object.assign(Object.assign({}, this.model.label.font), { fontFamily: this.model.label.font.fontFamily || 'msyh' });
40
41
  this.textElementModal = new TextElementModal(this.getDisplayText(), font, width, height);
41
42
  this.$element.append(this.textElementModal.Element);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.143",
3
+ "version": "3.0.0-alpha.144",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",