@meta2d/core 1.0.41 → 1.0.42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta2d/core",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -3921,11 +3921,18 @@ var Canvas = /** @class */ (function () {
3921
3921
  .getContext('2d')
3922
3922
  .scale(this.store.dpiRatio, this.store.dpiRatio);
3923
3923
  this.offscreen.getContext('2d').textBaseline = 'middle';
3924
- this.render();
3925
3924
  try {
3926
3925
  // TODO 窗口大小变化没有刷新图纸
3927
3926
  for (var _b = __values(this.store.data.pens), _c = _b.next(); !_c.done; _c = _b.next()) {
3928
3927
  var pen = _c.value;
3928
+ if (pen.isRuleLine) {
3929
+ if (!pen.width) {
3930
+ pen.height = this.height;
3931
+ }
3932
+ else if (!pen.height) {
3933
+ pen.width = this.width;
3934
+ }
3935
+ }
3929
3936
  calcInView(pen);
3930
3937
  }
3931
3938
  }
@@ -3936,6 +3943,7 @@ var Canvas = /** @class */ (function () {
3936
3943
  }
3937
3944
  finally { if (e_15) throw e_15.error; }
3938
3945
  }
3946
+ this.render();
3939
3947
  };
3940
3948
  Canvas.prototype.clearCanvas = function () {
3941
3949
  this.activeRect = undefined;
@@ -4899,7 +4907,7 @@ var Canvas = /** @class */ (function () {
4899
4907
  pen.onScale && pen.onScale(pen);
4900
4908
  if (pen.isRuleLine) {
4901
4909
  // 扩大线的比例,若是放大,即不缩小,若是缩小,会放大
4902
- var lineScale = s > 1 ? 1 : 1 / s / s;
4910
+ var lineScale = 1 / s; //s > 1 ? 1 : 1 / s / s;
4903
4911
  // 中心点即为线的中心
4904
4912
  var lineCenter = pen.calculative.worldRect.center;
4905
4913
  if (!pen.width) {
@@ -4914,6 +4922,7 @@ var Canvas = /** @class */ (function () {
4914
4922
  _this.updatePenRect(pen, { worldRectIsReady: true });
4915
4923
  _this.execPenResize(pen);
4916
4924
  });
4925
+ this.onMovePens();
4917
4926
  this.calcActiveRect();
4918
4927
  // setTimeout(() => {
4919
4928
  this.canvasTemplate.init();
@@ -6855,7 +6864,7 @@ var Canvas = /** @class */ (function () {
6855
6864
  if (needCalcTextRectProps.includes(k)) {
6856
6865
  willCalcTextRect = true;
6857
6866
  }
6858
- if (['name', 'borderRadius'].includes(k)) {
6867
+ if (['name', 'borderRadius', 'lineSmooth'].includes(k)) {
6859
6868
  willUpdatePath = true;
6860
6869
  }
6861
6870
  if (needSetPenProps.includes(k)) {