@hailin-zheng/editor-core 1.1.1 → 1.1.2

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.js CHANGED
@@ -4455,7 +4455,7 @@ class PSymbolElement extends LeafElement {
4455
4455
  super('psym');
4456
4456
  this.textProps = new TextProps();
4457
4457
  this.textProps.fontSize = this.defaultHeight;
4458
- this.textProps.fontName = '楷体';
4458
+ this.textProps.fontName = 'sans-serif';
4459
4459
  this.textProps.color = '#8c8c8c';
4460
4460
  }
4461
4461
  createRenderObject() {
@@ -4482,7 +4482,7 @@ class PSymbolRenderObject extends LeafRenderObject {
4482
4482
  if (render.drawMode === 'print') {
4483
4483
  return;
4484
4484
  }
4485
- render.contentContext.drawText('', this.element.textProps, position.x, position.y, 20, this.rect.height);
4485
+ render.contentContext.drawText('', this.element.textProps, position.x, position.y, 20, this.rect.height);
4486
4486
  }
4487
4487
  //绘制段落符号
4488
4488
  clone() {
@@ -12077,7 +12077,6 @@ class ParagraphMeasure {
12077
12077
  */
12078
12078
  setParaTextAlign(counter, paraLineIndex, paraElement, limitWidth, paraLineRender) {
12079
12079
  let indent = paraLineRender.startX;
12080
- paraLineRender.line.rect.width = limitWidth;
12081
12080
  if (paraElement.props.textAlign === 'center') {
12082
12081
  const remainSpace = limitWidth - paraLineRender.line.rect.width;
12083
12082
  const startX = Math.ceil(remainSpace / 2) + indent;
@@ -12101,6 +12100,7 @@ class ParagraphMeasure {
12101
12100
  //return indent;
12102
12101
  }
12103
12102
  else ;
12103
+ paraLineRender.line.rect.width = limitWidth;
12104
12104
  }
12105
12105
  /**
12106
12106
  * 设置两端对齐
@@ -14219,7 +14219,7 @@ class PageBreakRenderObject extends LeafRenderObject {
14219
14219
  if (render.drawMode === 'print') {
14220
14220
  return;
14221
14221
  }
14222
- render.contentContext.drawText('', this.element.textProps, position.x, position.y, 20, this.rect.height);
14222
+ render.contentContext.drawText('', this.element.textProps, position.x, position.y, 20, this.rect.height);
14223
14223
  }
14224
14224
  clone() {
14225
14225
  const render = new PageBreakRenderObject(this.element);
@@ -14742,7 +14742,8 @@ class DocumentEvent {
14742
14742
  };
14743
14743
  }
14744
14744
  }
14745
- if (!this.ismousedown) {
14745
+ //只有设计模式时,才需要进行边界判断,方可调整表格列宽等
14746
+ if (!this.ismousedown && this.viewOptions.docMode === DocMode.Design) {
14746
14747
  this.edgeRenderInfo = edgeRenderInfo;
14747
14748
  }
14748
14749
  //存在边界元素,并且当前边界处于鼠标按下状态
@@ -18602,6 +18603,7 @@ class ButtonBase extends TextBase {
18602
18603
 
18603
18604
  const ViewConfig = {
18604
18605
  surfaceBgColor: '#f0f0f0',
18606
+ showMousePositionLine: false,
18605
18607
  primaryColor: '#6750A4',
18606
18608
  onPrimaryColor: '#FFFFFF',
18607
18609
  themeSecondaryColor: '#2b88d8',
@@ -19423,8 +19425,8 @@ class ViewPaint {
19423
19425
  let { x, y } = lines[i];
19424
19426
  x = Math.ceil(x);
19425
19427
  y = Math.ceil(y);
19426
- x += 0.5;
19427
- y += 0.5;
19428
+ // x += 0.5;
19429
+ // y += 0.5;
19428
19430
  if (i === 0) {
19429
19431
  this.ctx.moveTo(x, y);
19430
19432
  }
@@ -19447,8 +19449,8 @@ class ViewPaint {
19447
19449
  }
19448
19450
  }
19449
19451
  drawRadioBox(x, y, width, height, isChecked) {
19450
- x = x + Math.floor(width / 2);
19451
- y = y + Math.floor(height / 2);
19452
+ // x = x + Math.floor(width / 2);
19453
+ // y = y + Math.floor(height / 2);
19452
19454
  width = Math.floor(width / 2);
19453
19455
  this.ctx.save();
19454
19456
  this.ctx.strokeStyle = 'black';
@@ -19592,6 +19594,13 @@ class SurfaceView extends NodeItems {
19592
19594
  this.reLayout = false;
19593
19595
  }
19594
19596
  e.render.fillRect(0, 0, this.finalRect.width, this.finalRect.height, ViewConfig.surfaceBgColor);
19597
+ e.next(e.render);
19598
+ this.drawMouseLinePosition(e);
19599
+ }
19600
+ drawMouseLinePosition(e) {
19601
+ {
19602
+ return;
19603
+ }
19595
19604
  }
19596
19605
  start() {
19597
19606
  this.renderSchedule = renderApp(this, this.renderCtx, this.nodeEvent);
@@ -20876,8 +20885,6 @@ class CanvasTextEditor extends NodeItems {
20876
20885
  pagePL = left;
20877
20886
  pagePR = right;
20878
20887
  }
20879
- // this.docRule.setRuleOptions({width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft});
20880
- // this.docRule.refreshRule();
20881
20888
  this.rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
20882
20889
  }
20883
20890
  createDocViewer() {
@@ -20976,12 +20983,17 @@ class CanvasTextEditor extends NodeItems {
20976
20983
  this.documentPaint.rePages();
20977
20984
  });
20978
20985
  this.updateDocSize();
20979
- //页面高度
20980
- // this.documentSelection.updateSelectionState();
20981
- // this.selectionOverlays.getSelectionTreeData();
20982
- // this.beforeRenderSubject.next();
20983
20986
  }
20984
- //生成选区内容对象
20987
+ this.updateSelection();
20988
+ this.refreshDocRule();
20989
+ this.onChanged();
20990
+ //this.refreshView();
20991
+ }
20992
+ /**
20993
+ * 计算选区内容对象
20994
+ * @private
20995
+ */
20996
+ updateSelection() {
20985
20997
  let ssChanged = false;
20986
20998
  try {
20987
20999
  //防止由于选区不正确导致的错误,导致后续的当前任务无法释放
@@ -20992,18 +21004,12 @@ class CanvasTextEditor extends NodeItems {
20992
21004
  }
20993
21005
  this.selectionOverlays.getSelectionTreeData();
20994
21006
  ssChanged && this.selectionChanged.next(this.documentSelection.selectionState);
20995
- this.refreshDocRule();
20996
- this.onChanged();
20997
- //this.refreshView();
20998
21007
  }
20999
21008
  /**
21000
21009
  * 刷新绘制文档
21001
21010
  * @param rePaint
21002
21011
  */
21003
21012
  refreshView() {
21004
- // const ssChanged = this.documentSelection.updateSelectionState();
21005
- // this.selectionOverlays.getSelectionTreeData();
21006
- // ssChanged && this.selectionChanged.next(this.documentSelection.selectionState);
21007
21013
  this.documentPaint.refreshView();
21008
21014
  this.setCursor();
21009
21015
  }
@@ -21195,8 +21201,6 @@ class CanvasTextEditor extends NodeItems {
21195
21201
  let minDocViewWidth = pageWidth + this.viewOptions.docSpace * 2;
21196
21202
  let maxDocViewWidth = this.surfaceView.width;
21197
21203
  this.width = Math.max(minDocViewWidth, maxDocViewWidth) - ScrollBarSize;
21198
- // this.viewOptions.viewSettings.width = this.width;
21199
- // this.viewOptions.viewSettings.height = this.scrollView.height as number;
21200
21204
  const docSize = this.documentPaint.getDocumentContainerHeight();
21201
21205
  this.height = docSize.height;
21202
21206
  this.updateRenderCtx();
@@ -21209,6 +21213,7 @@ class CanvasTextEditor extends NodeItems {
21209
21213
  this.updateRenderCtx();
21210
21214
  this.documentPaint.layoutPages();
21211
21215
  this.refreshDocument();
21216
+ this.updateLayout();
21212
21217
  }
21213
21218
  /**
21214
21219
  * 缩放视图
@@ -21697,7 +21702,6 @@ class CanvasTextEditor extends NodeItems {
21697
21702
  this.viewOptions.viewSettings.height = data.height;
21698
21703
  this.updateDocSize();
21699
21704
  this.resetViewer();
21700
- this.updateLayout();
21701
21705
  });
21702
21706
  surface.addChild(scrollView);
21703
21707
  const rule2 = new RuleControl(this.docCtx);
@@ -21707,6 +21711,7 @@ class CanvasTextEditor extends NodeItems {
21707
21711
  rule2.x = 20;
21708
21712
  rule2.y = 500;
21709
21713
  surface.addChild(rule2);
21714
+ //surface.addChild(win);
21710
21715
  surface.start();
21711
21716
  }
21712
21717
  /**