@leafer-draw/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 +8 -6
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.esm.js +9 -7
- 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 +311 -263
- 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 +310 -264
- 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 +7 -7
package/dist/worker.cjs
CHANGED
|
@@ -346,7 +346,7 @@ class Layouter {
|
|
|
346
346
|
}
|
|
347
347
|
partLayout() {
|
|
348
348
|
var _a;
|
|
349
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
349
|
+
if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
|
|
350
350
|
return;
|
|
351
351
|
const t = core.Run.start('PartLayout');
|
|
352
352
|
const { target, __updatedList: updateList } = this;
|
|
@@ -1036,7 +1036,7 @@ function getPatternData(paint, box, image) {
|
|
|
1036
1036
|
box = tempBox.set(box).shrink(paint.padding);
|
|
1037
1037
|
if (paint.mode === 'strench')
|
|
1038
1038
|
paint.mode = 'stretch';
|
|
1039
|
-
const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
|
|
1039
|
+
const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
|
|
1040
1040
|
const sameBox = box.width === width && box.height === height;
|
|
1041
1041
|
const data = { mode };
|
|
1042
1042
|
const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
|
|
@@ -1099,6 +1099,8 @@ function getPatternData(paint, box, image) {
|
|
|
1099
1099
|
data.height = height;
|
|
1100
1100
|
if (opacity)
|
|
1101
1101
|
data.opacity = opacity;
|
|
1102
|
+
if (filters)
|
|
1103
|
+
data.filters = filters;
|
|
1102
1104
|
if (repeat)
|
|
1103
1105
|
data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
|
|
1104
1106
|
return data;
|
|
@@ -1201,7 +1203,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1201
1203
|
scaleX = abs$1(scaleX);
|
|
1202
1204
|
scaleY = abs$1(scaleY);
|
|
1203
1205
|
const { image, data } = paint;
|
|
1204
|
-
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy,
|
|
1206
|
+
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
|
|
1205
1207
|
if (sx) {
|
|
1206
1208
|
imageMatrix = get$1();
|
|
1207
1209
|
copy$1(imageMatrix, transform);
|
|
@@ -1244,7 +1246,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1244
1246
|
}
|
|
1245
1247
|
scale(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
1246
1248
|
}
|
|
1247
|
-
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
|
|
1249
|
+
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
|
|
1248
1250
|
const pattern = image.getPattern(canvas, repeat || (core.Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
|
|
1249
1251
|
paint.style = pattern;
|
|
1250
1252
|
paint.patternId = id;
|
|
@@ -1320,7 +1322,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1320
1322
|
canvas.opacity *= data.opacity;
|
|
1321
1323
|
if (data.transform)
|
|
1322
1324
|
canvas.transform(data.transform);
|
|
1323
|
-
canvas.drawImage(paint.image.
|
|
1325
|
+
canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
|
|
1324
1326
|
canvas.restore();
|
|
1325
1327
|
return true;
|
|
1326
1328
|
}
|
|
@@ -1330,7 +1332,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1330
1332
|
}
|
|
1331
1333
|
else {
|
|
1332
1334
|
if (!paint.patternTask) {
|
|
1333
|
-
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this,
|
|
1335
|
+
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
1334
1336
|
paint.patternTask = null;
|
|
1335
1337
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
1336
1338
|
createPattern(ui, paint, pixelRatio);
|