@leafer-draw/miniapp 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/miniapp.cjs +8 -6
- package/dist/miniapp.cjs.map +1 -1
- package/dist/miniapp.esm.js +9 -7
- package/dist/miniapp.esm.js.map +1 -1
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +310 -264
- package/dist/miniapp.module.js.map +1 -1
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +8 -8
package/dist/miniapp.cjs
CHANGED
|
@@ -485,7 +485,7 @@ class Layouter {
|
|
|
485
485
|
}
|
|
486
486
|
partLayout() {
|
|
487
487
|
var _a;
|
|
488
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
488
|
+
if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
|
|
489
489
|
return;
|
|
490
490
|
const t = core.Run.start('PartLayout');
|
|
491
491
|
const { target, __updatedList: updateList } = this;
|
|
@@ -1175,7 +1175,7 @@ function getPatternData(paint, box, image) {
|
|
|
1175
1175
|
box = tempBox.set(box).shrink(paint.padding);
|
|
1176
1176
|
if (paint.mode === 'strench')
|
|
1177
1177
|
paint.mode = 'stretch';
|
|
1178
|
-
const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
|
|
1178
|
+
const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
|
|
1179
1179
|
const sameBox = box.width === width && box.height === height;
|
|
1180
1180
|
const data = { mode };
|
|
1181
1181
|
const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
|
|
@@ -1238,6 +1238,8 @@ function getPatternData(paint, box, image) {
|
|
|
1238
1238
|
data.height = height;
|
|
1239
1239
|
if (opacity)
|
|
1240
1240
|
data.opacity = opacity;
|
|
1241
|
+
if (filters)
|
|
1242
|
+
data.filters = filters;
|
|
1241
1243
|
if (repeat)
|
|
1242
1244
|
data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
|
|
1243
1245
|
return data;
|
|
@@ -1340,7 +1342,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1340
1342
|
scaleX = abs$1(scaleX);
|
|
1341
1343
|
scaleY = abs$1(scaleY);
|
|
1342
1344
|
const { image, data } = paint;
|
|
1343
|
-
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy,
|
|
1345
|
+
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
|
|
1344
1346
|
if (sx) {
|
|
1345
1347
|
imageMatrix = get$1();
|
|
1346
1348
|
copy$1(imageMatrix, transform);
|
|
@@ -1383,7 +1385,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1383
1385
|
}
|
|
1384
1386
|
scale(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
1385
1387
|
}
|
|
1386
|
-
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
|
|
1388
|
+
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
|
|
1387
1389
|
const pattern = image.getPattern(canvas, repeat || (core.Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
|
|
1388
1390
|
paint.style = pattern;
|
|
1389
1391
|
paint.patternId = id;
|
|
@@ -1459,7 +1461,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1459
1461
|
canvas.opacity *= data.opacity;
|
|
1460
1462
|
if (data.transform)
|
|
1461
1463
|
canvas.transform(data.transform);
|
|
1462
|
-
canvas.drawImage(paint.image.
|
|
1464
|
+
canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
|
|
1463
1465
|
canvas.restore();
|
|
1464
1466
|
return true;
|
|
1465
1467
|
}
|
|
@@ -1469,7 +1471,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1469
1471
|
}
|
|
1470
1472
|
else {
|
|
1471
1473
|
if (!paint.patternTask) {
|
|
1472
|
-
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this,
|
|
1474
|
+
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
1473
1475
|
paint.patternTask = null;
|
|
1474
1476
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
1475
1477
|
createPattern(ui, paint, pixelRatio);
|