html2canvas-pro 1.6.1 → 1.6.3
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 +9 -3
- package/dist/html2canvas-pro.esm.js.map +1 -1
- package/dist/html2canvas-pro.js +17 -7
- package/dist/html2canvas-pro.js.map +1 -1
- package/dist/html2canvas-pro.min.js +4 -4
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/render/canvas/canvas-renderer.js +7 -1
- package/dist/lib/render/canvas/canvas-renderer.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +29 -21
- package/.eslintrc.old +0 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* html2canvas-pro 1.6.
|
|
2
|
+
* html2canvas-pro 1.6.3 <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
|
*/
|
|
@@ -7982,7 +7982,13 @@ class CanvasRenderer extends Renderer {
|
|
|
7982
7982
|
const position = backgroundImage.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage.position;
|
|
7983
7983
|
const x = getAbsoluteValue(position[0], width);
|
|
7984
7984
|
const y = getAbsoluteValue(position[position.length - 1], height);
|
|
7985
|
-
|
|
7985
|
+
let [rx, ry] = calculateRadius(backgroundImage, x, y, width, height);
|
|
7986
|
+
// Handle edge case where radial gradient size is 0
|
|
7987
|
+
// Use a minimum value of 0.01 to ensure gradient is still rendered
|
|
7988
|
+
if (rx === 0 || ry === 0) {
|
|
7989
|
+
rx = Math.max(rx, 0.01);
|
|
7990
|
+
ry = Math.max(ry, 0.01);
|
|
7991
|
+
}
|
|
7986
7992
|
if (rx > 0 && ry > 0) {
|
|
7987
7993
|
const radialGradient = this.ctx.createRadialGradient(left + x, top + y, 0, left + x, top + y, rx);
|
|
7988
7994
|
processColorStops(backgroundImage.stops, rx * 2).forEach((colorStop) => radialGradient.addColorStop(colorStop.stop, asString(colorStop.color)));
|
|
@@ -8458,5 +8464,5 @@ const parseBackgroundColor = (context, element, backgroundColorOverride) => {
|
|
|
8458
8464
|
: defaultBackgroundColor;
|
|
8459
8465
|
};
|
|
8460
8466
|
|
|
8461
|
-
export { html2canvas as default };
|
|
8467
|
+
export { html2canvas as default, html2canvas };
|
|
8462
8468
|
//# sourceMappingURL=html2canvas-pro.esm.js.map
|