@leafer/core 1.9.1 → 1.9.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/lib/core.cjs +120 -66
- package/lib/core.esm.js +117 -67
- package/lib/core.esm.min.js +1 -1
- package/lib/core.esm.min.js.map +1 -1
- package/lib/core.min.cjs +1 -1
- package/lib/core.min.cjs.map +1 -1
- package/package.json +17 -17
- package/src/index.ts +1 -1
- package/types/index.d.ts +1 -1
package/lib/core.esm.js
CHANGED
|
@@ -476,9 +476,8 @@ const MatrixHelper = {
|
|
|
476
476
|
t.e = child.e * a + child.f * c + e;
|
|
477
477
|
t.f = child.e * b + child.f * d + f;
|
|
478
478
|
},
|
|
479
|
-
multiplyParent(t, parent, to, abcdChanged, childScaleData
|
|
480
|
-
|
|
481
|
-
if (scrollData) e += scrollData.scrollX, f += scrollData.scrollY;
|
|
479
|
+
multiplyParent(t, parent, to, abcdChanged, childScaleData) {
|
|
480
|
+
const {e: e, f: f} = t;
|
|
482
481
|
to || (to = t);
|
|
483
482
|
if (isUndefined(abcdChanged)) abcdChanged = t.a !== 1 || t.b || t.c || t.d !== 1;
|
|
484
483
|
if (abcdChanged) {
|
|
@@ -1191,6 +1190,12 @@ const BoundsHelper = {
|
|
|
1191
1190
|
t.x += x;
|
|
1192
1191
|
t.y += y;
|
|
1193
1192
|
},
|
|
1193
|
+
scroll(t, data) {
|
|
1194
|
+
if (data.scrollY || data.scrollX) {
|
|
1195
|
+
t.x += data.scrollX;
|
|
1196
|
+
t.y += data.scrollY;
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1194
1199
|
getByMove(t, x, y) {
|
|
1195
1200
|
t = Object.assign({}, t);
|
|
1196
1201
|
B.move(t, x, y);
|
|
@@ -2137,7 +2142,7 @@ __decorate([ contextMethod() ], Canvas.prototype, "measureText", null);
|
|
|
2137
2142
|
|
|
2138
2143
|
__decorate([ contextMethod() ], Canvas.prototype, "strokeText", null);
|
|
2139
2144
|
|
|
2140
|
-
const {copy: copy$5, multiplyParent: multiplyParent$3} = MatrixHelper, {round: round$1} = Math;
|
|
2145
|
+
const {copy: copy$5, multiplyParent: multiplyParent$3} = MatrixHelper, {round: round$1} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
|
|
2141
2146
|
|
|
2142
2147
|
const minSize = {
|
|
2143
2148
|
width: 1,
|
|
@@ -2302,44 +2307,44 @@ class LeaferCanvasBase extends Canvas {
|
|
|
2302
2307
|
const {pixelRatio: pixelRatio} = this;
|
|
2303
2308
|
this.filter = `blur(${blur * pixelRatio}px)`;
|
|
2304
2309
|
}
|
|
2305
|
-
copyWorld(canvas, from, to, blendMode) {
|
|
2310
|
+
copyWorld(canvas, from, to, blendMode, ceilPixel = true) {
|
|
2306
2311
|
if (blendMode) this.blendMode = blendMode;
|
|
2307
2312
|
if (from) {
|
|
2308
|
-
|
|
2309
|
-
if (!to) to =
|
|
2310
|
-
this.drawImage(canvas.view,
|
|
2313
|
+
this.setTempPixelBounds(from, ceilPixel);
|
|
2314
|
+
if (!to) to = tempPixelBounds; else this.setTempPixelBounds2(to, ceilPixel), to = tempPixelBounds2;
|
|
2315
|
+
this.drawImage(canvas.view, tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height, to.x, to.y, to.width, to.height);
|
|
2311
2316
|
} else {
|
|
2312
2317
|
this.drawImage(canvas.view, 0, 0);
|
|
2313
2318
|
}
|
|
2314
2319
|
if (blendMode) this.blendMode = "source-over";
|
|
2315
2320
|
}
|
|
2316
|
-
copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode) {
|
|
2317
|
-
if (blendMode) this.blendMode = blendMode;
|
|
2321
|
+
copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode, ceilPixel = true) {
|
|
2318
2322
|
if (fromWorld.b || fromWorld.c) {
|
|
2319
2323
|
this.save();
|
|
2320
2324
|
this.resetTransform();
|
|
2321
|
-
this.copyWorld(canvas, fromWorld, BoundsHelper.tempToOuterOf(toInnerBounds, fromWorld));
|
|
2325
|
+
this.copyWorld(canvas, fromWorld, BoundsHelper.tempToOuterOf(toInnerBounds, fromWorld), blendMode, ceilPixel);
|
|
2322
2326
|
this.restore();
|
|
2323
2327
|
} else {
|
|
2324
|
-
|
|
2325
|
-
this.
|
|
2328
|
+
if (blendMode) this.blendMode = blendMode;
|
|
2329
|
+
this.setTempPixelBounds(fromWorld, ceilPixel);
|
|
2330
|
+
this.drawImage(canvas.view, tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height, toInnerBounds.x, toInnerBounds.y, toInnerBounds.width, toInnerBounds.height);
|
|
2331
|
+
if (blendMode) this.blendMode = "source-over";
|
|
2326
2332
|
}
|
|
2327
|
-
if (blendMode) this.blendMode = "source-over";
|
|
2328
2333
|
}
|
|
2329
|
-
copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform) {
|
|
2334
|
+
copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform, ceilPixel = true) {
|
|
2330
2335
|
this.resetTransform();
|
|
2331
|
-
this.copyWorld(canvas, from, to, blendMode);
|
|
2336
|
+
this.copyWorld(canvas, from, to, blendMode, ceilPixel);
|
|
2332
2337
|
if (!onlyResetTransform) this.useWorldTransform();
|
|
2333
2338
|
}
|
|
2334
2339
|
useGrayscaleAlpha(bounds) {
|
|
2335
|
-
this.
|
|
2340
|
+
this.setTempPixelBounds(bounds, true, true);
|
|
2336
2341
|
let alpha, pixel;
|
|
2337
|
-
const {context: context} = this, imageData = context.getImageData(
|
|
2342
|
+
const {context: context} = this, imageData = context.getImageData(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height), {data: data} = imageData;
|
|
2338
2343
|
for (let i = 0, len = data.length; i < len; i += 4) {
|
|
2339
2344
|
pixel = data[i] * .299 + data[i + 1] * .587 + data[i + 2] * .114;
|
|
2340
2345
|
if (alpha = data[i + 3]) data[i + 3] = alpha === 255 ? pixel : alpha * (pixel / 255);
|
|
2341
2346
|
}
|
|
2342
|
-
context.putImageData(imageData,
|
|
2347
|
+
context.putImageData(imageData, tempPixelBounds.x, tempPixelBounds.y);
|
|
2343
2348
|
}
|
|
2344
2349
|
useMask(maskCanvas, fromBounds, toBounds) {
|
|
2345
2350
|
this.copyWorld(maskCanvas, fromBounds, toBounds, "destination-in");
|
|
@@ -2347,42 +2352,48 @@ class LeaferCanvasBase extends Canvas {
|
|
|
2347
2352
|
useEraser(eraserCanvas, fromBounds, toBounds) {
|
|
2348
2353
|
this.copyWorld(eraserCanvas, fromBounds, toBounds, "destination-out");
|
|
2349
2354
|
}
|
|
2350
|
-
fillWorld(bounds, color, blendMode) {
|
|
2355
|
+
fillWorld(bounds, color, blendMode, ceilPixel) {
|
|
2351
2356
|
if (blendMode) this.blendMode = blendMode;
|
|
2352
2357
|
this.fillStyle = color;
|
|
2353
|
-
this.
|
|
2354
|
-
this.fillRect(
|
|
2358
|
+
this.setTempPixelBounds(bounds, ceilPixel);
|
|
2359
|
+
this.fillRect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
|
|
2355
2360
|
if (blendMode) this.blendMode = "source-over";
|
|
2356
2361
|
}
|
|
2357
|
-
strokeWorld(bounds, color, blendMode) {
|
|
2362
|
+
strokeWorld(bounds, color, blendMode, ceilPixel) {
|
|
2358
2363
|
if (blendMode) this.blendMode = blendMode;
|
|
2359
2364
|
this.strokeStyle = color;
|
|
2360
|
-
this.
|
|
2361
|
-
this.strokeRect(
|
|
2365
|
+
this.setTempPixelBounds(bounds, ceilPixel);
|
|
2366
|
+
this.strokeRect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
|
|
2362
2367
|
if (blendMode) this.blendMode = "source-over";
|
|
2363
2368
|
}
|
|
2364
|
-
clipWorld(bounds, ceilPixel) {
|
|
2369
|
+
clipWorld(bounds, ceilPixel = true) {
|
|
2365
2370
|
this.beginPath();
|
|
2366
|
-
this.
|
|
2367
|
-
this.rect(
|
|
2371
|
+
this.setTempPixelBounds(bounds, ceilPixel);
|
|
2372
|
+
this.rect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
|
|
2368
2373
|
this.clip();
|
|
2369
2374
|
}
|
|
2370
2375
|
clipUI(ruleData) {
|
|
2371
2376
|
ruleData.windingRule ? this.clip(ruleData.windingRule) : this.clip();
|
|
2372
2377
|
}
|
|
2373
|
-
clearWorld(bounds, ceilPixel) {
|
|
2374
|
-
this.
|
|
2375
|
-
this.clearRect(
|
|
2378
|
+
clearWorld(bounds, ceilPixel = true) {
|
|
2379
|
+
this.setTempPixelBounds(bounds, ceilPixel);
|
|
2380
|
+
this.clearRect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
|
|
2376
2381
|
}
|
|
2377
2382
|
clear() {
|
|
2378
2383
|
const {pixelRatio: pixelRatio} = this;
|
|
2379
2384
|
this.clearRect(0, 0, this.width * pixelRatio + 2, this.height * pixelRatio + 2);
|
|
2380
2385
|
}
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
+
setTempPixelBounds(bounds, ceil, intersect) {
|
|
2387
|
+
this.copyToPixelBounds(tempPixelBounds, bounds, ceil, intersect);
|
|
2388
|
+
}
|
|
2389
|
+
setTempPixelBounds2(bounds, ceil, intersect) {
|
|
2390
|
+
this.copyToPixelBounds(tempPixelBounds2, bounds, ceil, intersect);
|
|
2391
|
+
}
|
|
2392
|
+
copyToPixelBounds(pixelBounds, bounds, ceil, intersect) {
|
|
2393
|
+
pixelBounds.set(bounds);
|
|
2394
|
+
if (intersect) pixelBounds.intersect(this.bounds);
|
|
2395
|
+
pixelBounds.scale(this.pixelRatio);
|
|
2396
|
+
if (ceil) pixelBounds.ceil();
|
|
2386
2397
|
}
|
|
2387
2398
|
isSameSize(size) {
|
|
2388
2399
|
return this.width === size.width && this.height === size.height && (!size.pixelRatio || this.pixelRatio === size.pixelRatio);
|
|
@@ -2398,7 +2409,7 @@ class LeaferCanvasBase extends Canvas {
|
|
|
2398
2409
|
recycle(clearBounds) {
|
|
2399
2410
|
if (!this.recycled) {
|
|
2400
2411
|
this.restore();
|
|
2401
|
-
clearBounds ? this.clearWorld(clearBounds
|
|
2412
|
+
clearBounds ? this.clearWorld(clearBounds) : this.clear();
|
|
2402
2413
|
this.manager ? this.manager.recycle(this) : this.destroy();
|
|
2403
2414
|
}
|
|
2404
2415
|
}
|
|
@@ -4138,6 +4149,17 @@ function positionType(defaultValue, checkFiniteNumber) {
|
|
|
4138
4149
|
}));
|
|
4139
4150
|
}
|
|
4140
4151
|
|
|
4152
|
+
function scrollType(defaultValue, checkFiniteNumber) {
|
|
4153
|
+
return decorateLeafAttr(defaultValue, key => attr({
|
|
4154
|
+
set(value) {
|
|
4155
|
+
if (this.__setAttr(key, value, checkFiniteNumber)) {
|
|
4156
|
+
this.__layout.matrixChanged || this.__layout.matrixChange();
|
|
4157
|
+
this.__scrollWorld || (this.__scrollWorld = {});
|
|
4158
|
+
}
|
|
4159
|
+
}
|
|
4160
|
+
}));
|
|
4161
|
+
}
|
|
4162
|
+
|
|
4141
4163
|
function autoLayoutType(defaultValue) {
|
|
4142
4164
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4143
4165
|
set(value) {
|
|
@@ -4552,7 +4574,7 @@ const LeafHelper = {
|
|
|
4552
4574
|
x: x,
|
|
4553
4575
|
y: y
|
|
4554
4576
|
};
|
|
4555
|
-
isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.
|
|
4577
|
+
isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.scrollWorldTransform, local, local, true);
|
|
4556
4578
|
L.moveLocal(t, local.x, local.y, transition);
|
|
4557
4579
|
},
|
|
4558
4580
|
moveLocal(t, x, y = 0, transition) {
|
|
@@ -4576,7 +4598,7 @@ const LeafHelper = {
|
|
|
4576
4598
|
}
|
|
4577
4599
|
copy$3(matrix, o);
|
|
4578
4600
|
scaleOfOuter(matrix, origin, scaleX, scaleY);
|
|
4579
|
-
if (
|
|
4601
|
+
if (L.hasHighPosition(t)) {
|
|
4580
4602
|
L.setTransform(t, matrix, resize, transition);
|
|
4581
4603
|
} else {
|
|
4582
4604
|
const x = t.x + matrix.e - o.e, y = t.y + matrix.f - o.f;
|
|
@@ -4595,7 +4617,7 @@ const LeafHelper = {
|
|
|
4595
4617
|
const o = t.__localMatrix;
|
|
4596
4618
|
copy$3(matrix, o);
|
|
4597
4619
|
rotateOfOuter(matrix, origin, angle);
|
|
4598
|
-
if (
|
|
4620
|
+
if (L.hasHighPosition(t)) L.setTransform(t, matrix, false, transition); else t.set({
|
|
4599
4621
|
x: t.x + matrix.e - o.e,
|
|
4600
4622
|
y: t.y + matrix.f - o.f,
|
|
4601
4623
|
rotation: MathHelper.formatRotation(t.rotation + angle)
|
|
@@ -4612,7 +4634,7 @@ const LeafHelper = {
|
|
|
4612
4634
|
transformWorld(t, transform, resize, transition) {
|
|
4613
4635
|
copy$3(matrix, t.worldTransform);
|
|
4614
4636
|
multiplyParent$2(matrix, transform);
|
|
4615
|
-
if (t.parent) divideParent(matrix, t.parent.
|
|
4637
|
+
if (t.parent) divideParent(matrix, t.parent.scrollWorldTransform);
|
|
4616
4638
|
L.setTransform(t, matrix, resize, transition);
|
|
4617
4639
|
},
|
|
4618
4640
|
transform(t, transform, resize, transition) {
|
|
@@ -4623,6 +4645,10 @@ const LeafHelper = {
|
|
|
4623
4645
|
setTransform(t, transform, resize, transition) {
|
|
4624
4646
|
const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
|
|
4625
4647
|
const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around));
|
|
4648
|
+
if (L.hasOffset(t)) {
|
|
4649
|
+
layout.x -= data.offsetX;
|
|
4650
|
+
layout.y -= data.offsetY;
|
|
4651
|
+
}
|
|
4626
4652
|
if (resize) {
|
|
4627
4653
|
const scaleX = layout.scaleX / t.scaleX, scaleY = layout.scaleY / t.scaleY;
|
|
4628
4654
|
delete layout.scaleX, delete layout.scaleY;
|
|
@@ -4651,13 +4677,19 @@ const LeafHelper = {
|
|
|
4651
4677
|
},
|
|
4652
4678
|
getRelativeWorld(t, relative, temp) {
|
|
4653
4679
|
copy$3(matrix, t.worldTransform);
|
|
4654
|
-
divideParent(matrix, relative.
|
|
4680
|
+
divideParent(matrix, relative.scrollWorldTransform);
|
|
4655
4681
|
return temp ? matrix : Object.assign({}, matrix);
|
|
4656
4682
|
},
|
|
4657
4683
|
drop(t, parent, index, resize) {
|
|
4658
4684
|
t.setTransform(L.getRelativeWorld(t, parent, true), resize);
|
|
4659
4685
|
parent.add(t, index);
|
|
4660
4686
|
},
|
|
4687
|
+
hasHighPosition(t) {
|
|
4688
|
+
return t.origin || t.around || L.hasOffset(t);
|
|
4689
|
+
},
|
|
4690
|
+
hasOffset(t) {
|
|
4691
|
+
return t.offsetX || t.offsetY;
|
|
4692
|
+
},
|
|
4661
4693
|
hasParent(p, parent) {
|
|
4662
4694
|
if (!parent) return false;
|
|
4663
4695
|
while (p) {
|
|
@@ -4683,8 +4715,7 @@ const L = LeafHelper;
|
|
|
4683
4715
|
const {updateAllMatrix: updateAllMatrix$1, updateMatrix: updateMatrix$1, updateAllWorldOpacity: updateAllWorldOpacity, updateAllChange: updateAllChange, updateChange: updateChange} = L;
|
|
4684
4716
|
|
|
4685
4717
|
function getTempLocal(t, world) {
|
|
4686
|
-
t.
|
|
4687
|
-
return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
|
|
4718
|
+
return t.parent ? PointHelper.tempToInnerOf(world, t.parent.scrollWorldTransform) : world;
|
|
4688
4719
|
}
|
|
4689
4720
|
|
|
4690
4721
|
const LeafBoundsHelper = {
|
|
@@ -5236,6 +5267,8 @@ ChildEvent.UNMOUNTED = "unmounted";
|
|
|
5236
5267
|
|
|
5237
5268
|
ChildEvent.DESTROY = "destroy";
|
|
5238
5269
|
|
|
5270
|
+
const SCROLL = "property.scroll";
|
|
5271
|
+
|
|
5239
5272
|
class PropertyEvent extends Event {
|
|
5240
5273
|
constructor(type, target, attrName, oldValue, newValue) {
|
|
5241
5274
|
super(type, target);
|
|
@@ -5249,6 +5282,13 @@ PropertyEvent.CHANGE = "property.change";
|
|
|
5249
5282
|
|
|
5250
5283
|
PropertyEvent.LEAFER_CHANGE = "property.leafer_change";
|
|
5251
5284
|
|
|
5285
|
+
PropertyEvent.SCROLL = SCROLL;
|
|
5286
|
+
|
|
5287
|
+
const extraPropertyEventMap = {
|
|
5288
|
+
scrollX: SCROLL,
|
|
5289
|
+
scrollY: SCROLL
|
|
5290
|
+
};
|
|
5291
|
+
|
|
5252
5292
|
class ImageEvent extends Event {
|
|
5253
5293
|
constructor(type, data) {
|
|
5254
5294
|
super(type);
|
|
@@ -5524,7 +5564,9 @@ class Eventer {
|
|
|
5524
5564
|
if (!id) return;
|
|
5525
5565
|
const list = isArray(id) ? id : [ id ];
|
|
5526
5566
|
list.forEach(item => {
|
|
5527
|
-
if (
|
|
5567
|
+
if (item) {
|
|
5568
|
+
if (!item.listener) isArray(item.type) && item.type.forEach(v => item.current.off(v[0], v[1], v[3])); else item.current.off(item.type, item.listener, item.options);
|
|
5569
|
+
}
|
|
5528
5570
|
});
|
|
5529
5571
|
list.length = 0;
|
|
5530
5572
|
}
|
|
@@ -5618,8 +5660,6 @@ const LeafDataProxy = {
|
|
|
5618
5660
|
}
|
|
5619
5661
|
if (isObject(newValue) || oldValue !== newValue) {
|
|
5620
5662
|
this.__realSetAttr(name, newValue);
|
|
5621
|
-
const {CHANGE: CHANGE} = PropertyEvent;
|
|
5622
|
-
const event = new PropertyEvent(CHANGE, this, name, oldValue, newValue);
|
|
5623
5663
|
if (this.isLeafer) {
|
|
5624
5664
|
this.emitEvent(new PropertyEvent(PropertyEvent.LEAFER_CHANGE, this, name, oldValue, newValue));
|
|
5625
5665
|
const transformEventName = leaferTransformAttrMap[name];
|
|
@@ -5627,10 +5667,10 @@ const LeafDataProxy = {
|
|
|
5627
5667
|
this.emitEvent(new LeaferEvent(transformEventName, this));
|
|
5628
5668
|
this.emitEvent(new LeaferEvent(LeaferEvent.TRANSFORM, this));
|
|
5629
5669
|
}
|
|
5630
|
-
} else {
|
|
5631
|
-
if (this.hasEvent(CHANGE)) this.emitEvent(event);
|
|
5632
5670
|
}
|
|
5633
|
-
this.
|
|
5671
|
+
this.emitPropertyEvent(PropertyEvent.CHANGE, name, oldValue, newValue);
|
|
5672
|
+
const extraPropertyEvent = extraPropertyEventMap[name];
|
|
5673
|
+
if (extraPropertyEvent) this.emitPropertyEvent(extraPropertyEvent, name, oldValue, newValue);
|
|
5634
5674
|
return true;
|
|
5635
5675
|
} else {
|
|
5636
5676
|
return false;
|
|
@@ -5640,6 +5680,11 @@ const LeafDataProxy = {
|
|
|
5640
5680
|
return true;
|
|
5641
5681
|
}
|
|
5642
5682
|
},
|
|
5683
|
+
emitPropertyEvent(type, name, oldValue, newValue) {
|
|
5684
|
+
const event = new PropertyEvent(type, this, name, oldValue, newValue);
|
|
5685
|
+
this.isLeafer || this.hasEvent(type) && this.emitEvent(event);
|
|
5686
|
+
this.leafer.emitEvent(event);
|
|
5687
|
+
},
|
|
5643
5688
|
__realSetAttr(name, newValue) {
|
|
5644
5689
|
const data = this.__;
|
|
5645
5690
|
data[name] = newValue;
|
|
@@ -5658,8 +5703,9 @@ const {toPoint: toPoint, tempPoint: tempPoint} = AroundHelper;
|
|
|
5658
5703
|
|
|
5659
5704
|
const LeafMatrix = {
|
|
5660
5705
|
__updateWorldMatrix() {
|
|
5661
|
-
const {parent: parent, __layout: __layout} = this;
|
|
5662
|
-
multiplyParent$1(this.__local || __layout, parent ? parent.__world : defaultWorld,
|
|
5706
|
+
const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
|
|
5707
|
+
multiplyParent$1(this.__local || __layout, parent ? parent.__scrollWorld || parent.__world : defaultWorld, __world, !!__layout.affectScaleOrRotation, __);
|
|
5708
|
+
if (__scrollWorld) translateInner(Object.assign(__scrollWorld, __world), __.scrollX, __.scrollY);
|
|
5663
5709
|
},
|
|
5664
5710
|
__updateLocalMatrix() {
|
|
5665
5711
|
if (this.__local) {
|
|
@@ -5756,7 +5802,7 @@ const LeafBounds = {
|
|
|
5756
5802
|
__updateLocalRenderBounds() {
|
|
5757
5803
|
toOuterOf$1(this.__layout.renderBounds, this.__localMatrix, this.__layout.localRenderBounds);
|
|
5758
5804
|
},
|
|
5759
|
-
__updateBoxBounds() {
|
|
5805
|
+
__updateBoxBounds(_secondLayout, _bounds) {
|
|
5760
5806
|
const b = this.__layout.boxBounds;
|
|
5761
5807
|
const data = this.__;
|
|
5762
5808
|
if (data.__pathInputed) {
|
|
@@ -5790,11 +5836,11 @@ const LeafBounds = {
|
|
|
5790
5836
|
data.__naturalWidth = layout.boxBounds.width;
|
|
5791
5837
|
data.__naturalHeight = layout.boxBounds.height;
|
|
5792
5838
|
},
|
|
5793
|
-
__updateStrokeBounds() {
|
|
5839
|
+
__updateStrokeBounds(_bounds) {
|
|
5794
5840
|
const layout = this.__layout;
|
|
5795
5841
|
copyAndSpread(layout.strokeBounds, layout.boxBounds, layout.strokeBoxSpread);
|
|
5796
5842
|
},
|
|
5797
|
-
__updateRenderBounds() {
|
|
5843
|
+
__updateRenderBounds(_bounds) {
|
|
5798
5844
|
const layout = this.__layout;
|
|
5799
5845
|
layout.renderSpread > 0 ? copyAndSpread(layout.renderBounds, layout.boxBounds, layout.renderSpread) : copy$1(layout.renderBounds, layout.strokeBounds);
|
|
5800
5846
|
}
|
|
@@ -5943,6 +5989,10 @@ let Leaf = class Leaf {
|
|
|
5943
5989
|
get localTransform() {
|
|
5944
5990
|
return this.__layout.getTransform("local");
|
|
5945
5991
|
}
|
|
5992
|
+
get scrollWorldTransform() {
|
|
5993
|
+
this.updateLayout();
|
|
5994
|
+
return this.__scrollWorld || this.__world;
|
|
5995
|
+
}
|
|
5946
5996
|
get boxBounds() {
|
|
5947
5997
|
return this.getBounds("box", "inner");
|
|
5948
5998
|
}
|
|
@@ -5959,7 +6009,7 @@ let Leaf = class Leaf {
|
|
|
5959
6009
|
return this.getBounds("render");
|
|
5960
6010
|
}
|
|
5961
6011
|
get worldOpacity() {
|
|
5962
|
-
this.
|
|
6012
|
+
this.updateLayout();
|
|
5963
6013
|
return this.__worldOpacity;
|
|
5964
6014
|
}
|
|
5965
6015
|
get __worldFlipped() {
|
|
@@ -6134,10 +6184,10 @@ let Leaf = class Leaf {
|
|
|
6134
6184
|
__updateLocalBoxBounds() {}
|
|
6135
6185
|
__updateLocalStrokeBounds() {}
|
|
6136
6186
|
__updateLocalRenderBounds() {}
|
|
6137
|
-
__updateBoxBounds() {}
|
|
6187
|
+
__updateBoxBounds(_secondLayout, _bounds) {}
|
|
6138
6188
|
__updateContentBounds() {}
|
|
6139
|
-
__updateStrokeBounds() {}
|
|
6140
|
-
__updateRenderBounds() {}
|
|
6189
|
+
__updateStrokeBounds(_bounds) {}
|
|
6190
|
+
__updateRenderBounds(_bounds) {}
|
|
6141
6191
|
__updateAutoLayout() {}
|
|
6142
6192
|
__updateFlowLayout() {}
|
|
6143
6193
|
__updateNaturalSize() {}
|
|
@@ -6437,14 +6487,14 @@ let Branch = class Branch extends Leaf {
|
|
|
6437
6487
|
}
|
|
6438
6488
|
return 0;
|
|
6439
6489
|
}
|
|
6440
|
-
__updateBoxBounds() {
|
|
6441
|
-
setListWithFn(this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds);
|
|
6490
|
+
__updateBoxBounds(_secondLayout, bounds) {
|
|
6491
|
+
setListWithFn(bounds || this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds);
|
|
6442
6492
|
}
|
|
6443
|
-
__updateStrokeBounds() {
|
|
6444
|
-
setListWithFn(this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds);
|
|
6493
|
+
__updateStrokeBounds(bounds) {
|
|
6494
|
+
setListWithFn(bounds || this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds);
|
|
6445
6495
|
}
|
|
6446
|
-
__updateRenderBounds() {
|
|
6447
|
-
setListWithFn(this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds);
|
|
6496
|
+
__updateRenderBounds(bounds) {
|
|
6497
|
+
setListWithFn(bounds || this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds);
|
|
6448
6498
|
}
|
|
6449
6499
|
__updateSortChildren() {
|
|
6450
6500
|
let affectSort;
|
|
@@ -6691,6 +6741,6 @@ class LeafLevelList {
|
|
|
6691
6741
|
}
|
|
6692
6742
|
}
|
|
6693
6743
|
|
|
6694
|
-
const version = "1.9.
|
|
6744
|
+
const version = "1.9.2";
|
|
6695
6745
|
|
|
6696
|
-
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferImage, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };
|
|
6746
|
+
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferImage, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };
|