@leafer-ui/worker 1.4.0 → 1.4.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/dist/worker.cjs +12 -9
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.esm.js +14 -11
- package/dist/worker.esm.js.map +1 -1
- package/dist/worker.esm.min.js +1 -1
- package/dist/worker.esm.min.js.map +1 -1
- package/dist/worker.js +323 -272
- package/dist/worker.js.map +1 -1
- package/dist/worker.min.cjs +1 -1
- package/dist/worker.min.cjs.map +1 -1
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +322 -273
- package/dist/worker.module.js.map +1 -1
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +10 -10
package/dist/worker.cjs
CHANGED
|
@@ -347,7 +347,7 @@ class Layouter {
|
|
|
347
347
|
}
|
|
348
348
|
partLayout() {
|
|
349
349
|
var _a;
|
|
350
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
350
|
+
if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
|
|
351
351
|
return;
|
|
352
352
|
const t = core.Run.start('PartLayout');
|
|
353
353
|
const { target, __updatedList: updateList } = this;
|
|
@@ -812,9 +812,10 @@ class Selector {
|
|
|
812
812
|
this.finder = core.Creator.finder && core.Creator.finder();
|
|
813
813
|
}
|
|
814
814
|
getByPoint(hitPoint, hitRadius, options) {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
815
|
+
const { target, picker } = this;
|
|
816
|
+
if (core.Platform.backgrounder)
|
|
817
|
+
target && target.updateLayout();
|
|
818
|
+
return picker.getByPoint(hitPoint, hitRadius, options);
|
|
818
819
|
}
|
|
819
820
|
getBy(condition, branch, one, options) {
|
|
820
821
|
return this.finder ? this.finder.getBy(condition, branch, one, options) : core.Plugin.need('find');
|
|
@@ -1193,7 +1194,7 @@ function getPatternData(paint, box, image) {
|
|
|
1193
1194
|
box = tempBox.set(box).shrink(paint.padding);
|
|
1194
1195
|
if (paint.mode === 'strench')
|
|
1195
1196
|
paint.mode = 'stretch';
|
|
1196
|
-
const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
|
|
1197
|
+
const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
|
|
1197
1198
|
const sameBox = box.width === width && box.height === height;
|
|
1198
1199
|
const data = { mode };
|
|
1199
1200
|
const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
|
|
@@ -1256,6 +1257,8 @@ function getPatternData(paint, box, image) {
|
|
|
1256
1257
|
data.height = height;
|
|
1257
1258
|
if (opacity)
|
|
1258
1259
|
data.opacity = opacity;
|
|
1260
|
+
if (filters)
|
|
1261
|
+
data.filters = filters;
|
|
1259
1262
|
if (repeat)
|
|
1260
1263
|
data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
|
|
1261
1264
|
return data;
|
|
@@ -1358,7 +1361,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1358
1361
|
scaleX = abs$1(scaleX);
|
|
1359
1362
|
scaleY = abs$1(scaleY);
|
|
1360
1363
|
const { image, data } = paint;
|
|
1361
|
-
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy,
|
|
1364
|
+
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
|
|
1362
1365
|
if (sx) {
|
|
1363
1366
|
imageMatrix = get$1();
|
|
1364
1367
|
copy$1(imageMatrix, transform);
|
|
@@ -1401,7 +1404,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1401
1404
|
}
|
|
1402
1405
|
scale(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
1403
1406
|
}
|
|
1404
|
-
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
|
|
1407
|
+
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
|
|
1405
1408
|
const pattern = image.getPattern(canvas, repeat || (core.Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
|
|
1406
1409
|
paint.style = pattern;
|
|
1407
1410
|
paint.patternId = id;
|
|
@@ -1477,7 +1480,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1477
1480
|
canvas.opacity *= data.opacity;
|
|
1478
1481
|
if (data.transform)
|
|
1479
1482
|
canvas.transform(data.transform);
|
|
1480
|
-
canvas.drawImage(paint.image.
|
|
1483
|
+
canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
|
|
1481
1484
|
canvas.restore();
|
|
1482
1485
|
return true;
|
|
1483
1486
|
}
|
|
@@ -1487,7 +1490,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1487
1490
|
}
|
|
1488
1491
|
else {
|
|
1489
1492
|
if (!paint.patternTask) {
|
|
1490
|
-
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this,
|
|
1493
|
+
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
1491
1494
|
paint.patternTask = null;
|
|
1492
1495
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
1493
1496
|
createPattern(ui, paint, pixelRatio);
|