leafer-draw 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/web.cjs +9 -7
- package/dist/web.cjs.map +1 -1
- package/dist/web.esm.js +10 -8
- package/dist/web.esm.js.map +1 -1
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +312 -264
- package/dist/web.js.map +1 -1
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +311 -265
- package/dist/web.module.js.map +1 -1
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +2 -2
package/dist/web.cjs
CHANGED
|
@@ -258,7 +258,7 @@ if (userAgent.indexOf("Firefox") > -1) {
|
|
|
258
258
|
core.Platform.intWheelDeltaY = true;
|
|
259
259
|
core.Platform.syncDomFont = true;
|
|
260
260
|
}
|
|
261
|
-
else if (userAgent.indexOf("
|
|
261
|
+
else if (userAgent.indexOf("AppleWebKit") > -1) {
|
|
262
262
|
core.Platform.fullImageShadow = true;
|
|
263
263
|
}
|
|
264
264
|
if (userAgent.indexOf('Windows') > -1) {
|
|
@@ -527,7 +527,7 @@ class Layouter {
|
|
|
527
527
|
}
|
|
528
528
|
partLayout() {
|
|
529
529
|
var _a;
|
|
530
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
530
|
+
if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
|
|
531
531
|
return;
|
|
532
532
|
const t = core.Run.start('PartLayout');
|
|
533
533
|
const { target, __updatedList: updateList } = this;
|
|
@@ -1217,7 +1217,7 @@ function getPatternData(paint, box, image) {
|
|
|
1217
1217
|
box = tempBox.set(box).shrink(paint.padding);
|
|
1218
1218
|
if (paint.mode === 'strench')
|
|
1219
1219
|
paint.mode = 'stretch';
|
|
1220
|
-
const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
|
|
1220
|
+
const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
|
|
1221
1221
|
const sameBox = box.width === width && box.height === height;
|
|
1222
1222
|
const data = { mode };
|
|
1223
1223
|
const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
|
|
@@ -1280,6 +1280,8 @@ function getPatternData(paint, box, image) {
|
|
|
1280
1280
|
data.height = height;
|
|
1281
1281
|
if (opacity)
|
|
1282
1282
|
data.opacity = opacity;
|
|
1283
|
+
if (filters)
|
|
1284
|
+
data.filters = filters;
|
|
1283
1285
|
if (repeat)
|
|
1284
1286
|
data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
|
|
1285
1287
|
return data;
|
|
@@ -1382,7 +1384,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1382
1384
|
scaleX = abs$1(scaleX);
|
|
1383
1385
|
scaleY = abs$1(scaleY);
|
|
1384
1386
|
const { image, data } = paint;
|
|
1385
|
-
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy,
|
|
1387
|
+
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
|
|
1386
1388
|
if (sx) {
|
|
1387
1389
|
imageMatrix = get$1();
|
|
1388
1390
|
copy$1(imageMatrix, transform);
|
|
@@ -1425,7 +1427,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1425
1427
|
}
|
|
1426
1428
|
scale(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
1427
1429
|
}
|
|
1428
|
-
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
|
|
1430
|
+
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
|
|
1429
1431
|
const pattern = image.getPattern(canvas, repeat || (core.Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
|
|
1430
1432
|
paint.style = pattern;
|
|
1431
1433
|
paint.patternId = id;
|
|
@@ -1501,7 +1503,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1501
1503
|
canvas.opacity *= data.opacity;
|
|
1502
1504
|
if (data.transform)
|
|
1503
1505
|
canvas.transform(data.transform);
|
|
1504
|
-
canvas.drawImage(paint.image.
|
|
1506
|
+
canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
|
|
1505
1507
|
canvas.restore();
|
|
1506
1508
|
return true;
|
|
1507
1509
|
}
|
|
@@ -1511,7 +1513,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1511
1513
|
}
|
|
1512
1514
|
else {
|
|
1513
1515
|
if (!paint.patternTask) {
|
|
1514
|
-
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this,
|
|
1516
|
+
paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
1515
1517
|
paint.patternTask = null;
|
|
1516
1518
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
1517
1519
|
createPattern(ui, paint, pixelRatio);
|