@meta2d/core 1.0.49 → 1.0.51
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 +19 -9
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.d.ts +11 -1
- package/src/core.js +482 -224
- package/src/core.js.map +1 -1
- package/src/event/event.d.ts +2 -0
- package/src/event/event.js.map +1 -1
- package/src/options.d.ts +1 -0
- package/src/options.js.map +1 -1
- package/src/pen/model.d.ts +3 -1
- package/src/pen/model.js.map +1 -1
- package/src/store/store.d.ts +11 -0
- package/src/store/store.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -279,7 +279,7 @@ var Canvas = /** @class */ (function () {
|
|
|
279
279
|
}
|
|
280
280
|
if (Math.abs(e.wheelDelta) > 100) {
|
|
281
281
|
//鼠标滚轮滚动 scroll模式下是上下滚动而不是缩放
|
|
282
|
-
if (_this.store.options.scroll && _this.scroll) {
|
|
282
|
+
if (_this.store.options.scroll && _this.scroll && !_this.store.options.scrollButScale) {
|
|
283
283
|
_this.scroll.wheel(e.deltaY < 0);
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
@@ -3189,7 +3189,7 @@ var Canvas = /** @class */ (function () {
|
|
|
3189
3189
|
Canvas.prototype.dropPens = function (pens, e) {
|
|
3190
3190
|
var _a;
|
|
3191
3191
|
return __awaiter(this, void 0, void 0, function () {
|
|
3192
|
-
var pens_2, pens_2_1, pen, pens_3, pens_3_1, pen, pens_4, pens_4_1, pen, pens_5, pens_5_1, pen, width, height, rect_1, flag, pens_6, pens_6_1, pen, points;
|
|
3192
|
+
var pens_2, pens_2_1, pen, pens_3, pens_3_1, pen, pens_4, pens_4_1, pen, num, lastH, lastW, pens_5, pens_5_1, pen, width, height, rect_1, flag, pens_6, pens_6_1, pen, points;
|
|
3193
3193
|
var e_7, _b, e_8, _c, e_9, _d, e_10, _e, e_11, _f;
|
|
3194
3194
|
var _this = this;
|
|
3195
3195
|
return __generator(this, function (_g) {
|
|
@@ -3253,23 +3253,33 @@ var Canvas = /** @class */ (function () {
|
|
|
3253
3253
|
}
|
|
3254
3254
|
finally { if (e_9) throw e_9.error; }
|
|
3255
3255
|
}
|
|
3256
|
+
num = 0;
|
|
3257
|
+
lastH = 0;
|
|
3258
|
+
lastW = 0;
|
|
3256
3259
|
try {
|
|
3257
|
-
// // 计算区域
|
|
3258
|
-
// for (const pen of pens) {
|
|
3259
|
-
// // 组合节点才需要提前计算
|
|
3260
|
-
// Array.isArray(pen.children) && pen.children.length > 0 && this.updatePenRect(pen);
|
|
3261
|
-
// }
|
|
3262
3260
|
for (pens_5 = __values(pens), pens_5_1 = pens_5.next(); !pens_5_1.done; pens_5_1 = pens_5.next()) {
|
|
3263
3261
|
pen = pens_5_1.value;
|
|
3264
3262
|
if (!pen.parentId) {
|
|
3265
3263
|
pen.width *= this.store.data.scale;
|
|
3266
3264
|
pen.height *= this.store.data.scale;
|
|
3267
|
-
pen.x = e.x - pen.width / 2;
|
|
3268
|
-
pen.y = e.y - pen.height / 2;
|
|
3265
|
+
pen.x = e.x - pen.width / 2 + lastW;
|
|
3266
|
+
pen.y = e.y - pen.height / 2 + lastH;
|
|
3269
3267
|
if (pen.tags && pen.tags.includes('meta3d')) {
|
|
3270
3268
|
pen.x = this.store.data.origin.x;
|
|
3271
3269
|
pen.y = this.store.data.origin.y;
|
|
3272
3270
|
}
|
|
3271
|
+
if (pen.dataset) {
|
|
3272
|
+
if (num % 2 === 0) {
|
|
3273
|
+
lastW = pen.width + 10;
|
|
3274
|
+
}
|
|
3275
|
+
else {
|
|
3276
|
+
lastW = 0;
|
|
3277
|
+
}
|
|
3278
|
+
num++;
|
|
3279
|
+
if (num % 2 === 0) {
|
|
3280
|
+
lastH += pen.height + 10;
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3273
3283
|
}
|
|
3274
3284
|
}
|
|
3275
3285
|
}
|