html2canvas-pro 2.2.1 → 2.2.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/html2canvas-pro.esm.js +18 -4
- package/dist/html2canvas-pro.esm.js.map +1 -1
- package/dist/html2canvas-pro.js +18 -4
- package/dist/html2canvas-pro.js.map +1 -1
- package/dist/html2canvas-pro.min.js +2 -2
- package/dist/lib/render/canvas/effects-renderer.js +11 -8
- package/dist/lib/render/effects.js +15 -1
- package/dist/types/render/effects.d.ts +9 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* html2canvas-pro 2.2.
|
|
2
|
+
* html2canvas-pro 2.2.2 <https://yorickshan.github.io/html2canvas-pro/>
|
|
3
3
|
* Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
|
|
4
4
|
* Released under MIT License
|
|
5
5
|
*/
|
|
@@ -8442,9 +8442,18 @@ var BlendEffect = class {
|
|
|
8442
8442
|
};
|
|
8443
8443
|
var FilterEffect = class {
|
|
8444
8444
|
constructor(filterString) {
|
|
8445
|
-
this.filterString = filterString;
|
|
8446
8445
|
this.type = 5;
|
|
8447
8446
|
this.target = 6;
|
|
8447
|
+
const dropShadowMatch = filterString.match(/drop-shadow\(\s*([\d.-]+)(px)?\s+([\d.-]+)(px)?\s+([\d.-]+)(px)?\s+(.+?)\s*\)/);
|
|
8448
|
+
if (dropShadowMatch) {
|
|
8449
|
+
this.shadow = {
|
|
8450
|
+
offsetX: parseFloat(dropShadowMatch[1]),
|
|
8451
|
+
offsetY: parseFloat(dropShadowMatch[3]),
|
|
8452
|
+
blur: parseFloat(dropShadowMatch[5]),
|
|
8453
|
+
color: dropShadowMatch[7].trim()
|
|
8454
|
+
};
|
|
8455
|
+
this.safeFilterString = filterString.replace(/drop-shadow\([^)]+\)\s*/g, "").trim();
|
|
8456
|
+
} else this.safeFilterString = filterString;
|
|
8448
8457
|
}
|
|
8449
8458
|
};
|
|
8450
8459
|
const isTransformEffect = (effect) => effect.type === 0;
|
|
@@ -9900,8 +9909,13 @@ var EffectsRenderer = class {
|
|
|
9900
9909
|
} else if (isClipPathEffect(effect)) effect.applyClip(this.ctx);
|
|
9901
9910
|
else if (isBlendEffect(effect)) this.ctx.globalCompositeOperation = effect.compositeOperation;
|
|
9902
9911
|
else if (isFilterEffect(effect)) {
|
|
9903
|
-
|
|
9904
|
-
|
|
9912
|
+
this.ctx.filter = effect.safeFilterString || "none";
|
|
9913
|
+
if (effect.shadow) {
|
|
9914
|
+
this.ctx.shadowOffsetX = effect.shadow.offsetX;
|
|
9915
|
+
this.ctx.shadowOffsetY = effect.shadow.offsetY;
|
|
9916
|
+
this.ctx.shadowBlur = effect.shadow.blur;
|
|
9917
|
+
this.ctx.shadowColor = effect.shadow.color;
|
|
9918
|
+
}
|
|
9905
9919
|
}
|
|
9906
9920
|
this.activeEffects.push(effect);
|
|
9907
9921
|
}
|