@meta2d/core 1.0.66 → 1.0.67
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 +1 -1
- package/src/canvas/canvas.js +23 -9
- package/src/canvas/canvas.js.map +1 -1
- package/src/canvas/magnifierCanvas.js +1 -0
- package/src/canvas/magnifierCanvas.js.map +1 -1
- package/src/core.js +64 -3
- package/src/core.js.map +1 -1
- package/src/diagrams/line/line.js +2 -1
- package/src/diagrams/line/line.js.map +1 -1
- package/src/map/map.d.ts +1 -0
- package/src/map/map.js +10 -1
- package/src/map/map.js.map +1 -1
- package/src/pen/model.d.ts +1 -0
- package/src/pen/model.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -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
|
|
6054
|
+
if (delPen && delPen.calculative) {
|
|
6055
|
+
delPen.calculative.active = undefined;
|
|
6056
|
+
}
|
|
6055
6057
|
delPens.push(delPen);
|
|
6056
6058
|
}
|
|
6057
6059
|
if (pen.children) {
|
|
@@ -6995,7 +6997,7 @@ export class Canvas {
|
|
|
6995
6997
|
const oldRect = deepClone(rect);
|
|
6996
6998
|
const storeData = this.store.data;
|
|
6997
6999
|
// TODO: 目前背景颜色优先级更高
|
|
6998
|
-
const isDrawBkImg = containBkImg &&
|
|
7000
|
+
const isDrawBkImg = containBkImg && this.store.bkImg;
|
|
6999
7001
|
// 主体在背景的右侧,下侧
|
|
7000
7002
|
let isRight = false, isBottom = false;
|
|
7001
7003
|
if (isDrawBkImg) {
|
|
@@ -7066,16 +7068,11 @@ export class Canvas {
|
|
|
7066
7068
|
ctx.textBaseline = 'middle'; // 默认垂直居中
|
|
7067
7069
|
ctx.scale(scale, scale);
|
|
7068
7070
|
const background = this.store.data.background || this.store.options.background;
|
|
7069
|
-
if (background) {
|
|
7071
|
+
if (background && isV) {
|
|
7070
7072
|
// 绘制背景颜色
|
|
7071
7073
|
ctx.save();
|
|
7072
7074
|
ctx.fillStyle = background;
|
|
7073
|
-
|
|
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
|
-
}
|
|
7075
|
+
ctx.fillRect(0, 0, vRect.width + (p[1] + p[3]) * _scale, vRect.height + (p[0] + p[2]) * _scale);
|
|
7079
7076
|
ctx.restore();
|
|
7080
7077
|
}
|
|
7081
7078
|
if (isDrawBkImg) {
|
|
@@ -7088,6 +7085,23 @@ export class Canvas {
|
|
|
7088
7085
|
ctx.drawImage(this.store.bkImg, x, y, this.canvasRect.width, this.canvasRect.height);
|
|
7089
7086
|
}
|
|
7090
7087
|
}
|
|
7088
|
+
if (background && !isV) {
|
|
7089
|
+
// 绘制背景颜色
|
|
7090
|
+
if (isDrawBkImg) {
|
|
7091
|
+
const x = rect.x < 0 ? -rect.x : 0;
|
|
7092
|
+
const y = rect.y < 0 ? -rect.y : 0;
|
|
7093
|
+
ctx.save();
|
|
7094
|
+
ctx.fillStyle = background;
|
|
7095
|
+
ctx.fillRect(x, y, this.canvasRect.width, this.canvasRect.height);
|
|
7096
|
+
ctx.restore();
|
|
7097
|
+
}
|
|
7098
|
+
else {
|
|
7099
|
+
ctx.save();
|
|
7100
|
+
ctx.fillStyle = background;
|
|
7101
|
+
ctx.fillRect(0, 0, oldRect.width + (p[3] + p[1]) * _scale, oldRect.height + (p[0] + p[2]) * _scale);
|
|
7102
|
+
ctx.restore();
|
|
7103
|
+
}
|
|
7104
|
+
}
|
|
7091
7105
|
if (!isDrawBkImg) {
|
|
7092
7106
|
ctx.translate(-rect.x, -rect.y);
|
|
7093
7107
|
}
|