@meta2d/core 1.0.66 → 1.0.68

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.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from './src/rect';
7
7
  export * from './src/point';
8
8
  export * from './src/event';
9
9
  export * from './src/store';
10
+ export * from './src/theme';
package/index.js CHANGED
@@ -7,4 +7,5 @@ export * from './src/rect';
7
7
  export * from './src/point';
8
8
  export * from './src/event';
9
9
  export * from './src/store';
10
+ export * from './src/theme';
10
11
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta2d/core",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
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",
@@ -6051,7 +6051,9 @@ export class Canvas {
6051
6051
  const i = this.store.data.pens.findIndex((item) => item.id === pen.id);
6052
6052
  if (i > -1) {
6053
6053
  const delPen = this.store.pens[pen.id];
6054
- delPen.calculative.active = undefined;
6054
+ if (delPen && delPen.calculative) {
6055
+ delPen.calculative.active = undefined;
6056
+ }
6055
6057
  delPens.push(delPen);
6056
6058
  }
6057
6059
  if (pen.children) {
@@ -6758,6 +6760,13 @@ export class Canvas {
6758
6760
  const child = this.store.pens[childId];
6759
6761
  child.parentId = newId;
6760
6762
  });
6763
+ //form表单关系
6764
+ if (pen.formId) {
6765
+ pen.followers.forEach((id) => {
6766
+ const followerPen = this.store.pens[id];
6767
+ followerPen.formId = newId;
6768
+ });
6769
+ }
6761
6770
  // 连接关系
6762
6771
  if (pen.type === PenType.Line) {
6763
6772
  // TODO: 仍然存在 节点类型的 连线,此处判断需要更改
@@ -6995,7 +7004,7 @@ export class Canvas {
6995
7004
  const oldRect = deepClone(rect);
6996
7005
  const storeData = this.store.data;
6997
7006
  // TODO: 目前背景颜色优先级更高
6998
- const isDrawBkImg = containBkImg && !storeData.background && this.store.bkImg;
7007
+ const isDrawBkImg = containBkImg && this.store.bkImg;
6999
7008
  // 主体在背景的右侧,下侧
7000
7009
  let isRight = false, isBottom = false;
7001
7010
  if (isDrawBkImg) {
@@ -7066,16 +7075,11 @@ export class Canvas {
7066
7075
  ctx.textBaseline = 'middle'; // 默认垂直居中
7067
7076
  ctx.scale(scale, scale);
7068
7077
  const background = this.store.data.background || this.store.options.background;
7069
- if (background) {
7078
+ if (background && isV) {
7070
7079
  // 绘制背景颜色
7071
7080
  ctx.save();
7072
7081
  ctx.fillStyle = background;
7073
- if (isV) {
7074
- ctx.fillRect(0, 0, vRect.width + (p[1] + p[3]) * _scale, vRect.height + (p[0] + p[2]) * _scale);
7075
- }
7076
- else {
7077
- ctx.fillRect(0, 0, oldRect.width + (p[3] + p[1]) * _scale, oldRect.height + (p[0] + p[2]) * _scale);
7078
- }
7082
+ ctx.fillRect(0, 0, vRect.width + (p[1] + p[3]) * _scale, vRect.height + (p[0] + p[2]) * _scale);
7079
7083
  ctx.restore();
7080
7084
  }
7081
7085
  if (isDrawBkImg) {
@@ -7088,6 +7092,23 @@ export class Canvas {
7088
7092
  ctx.drawImage(this.store.bkImg, x, y, this.canvasRect.width, this.canvasRect.height);
7089
7093
  }
7090
7094
  }
7095
+ if (background && !isV) {
7096
+ // 绘制背景颜色
7097
+ if (isDrawBkImg) {
7098
+ const x = rect.x < 0 ? -rect.x : 0;
7099
+ const y = rect.y < 0 ? -rect.y : 0;
7100
+ ctx.save();
7101
+ ctx.fillStyle = background;
7102
+ ctx.fillRect(x, y, this.canvasRect.width, this.canvasRect.height);
7103
+ ctx.restore();
7104
+ }
7105
+ else {
7106
+ ctx.save();
7107
+ ctx.fillStyle = background;
7108
+ ctx.fillRect(0, 0, oldRect.width + (p[3] + p[1]) * _scale, oldRect.height + (p[0] + p[2]) * _scale);
7109
+ ctx.restore();
7110
+ }
7111
+ }
7091
7112
  if (!isDrawBkImg) {
7092
7113
  ctx.translate(-rect.x, -rect.y);
7093
7114
  }