html2canvas-pro 1.6.2 → 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 +8 -2
- package/dist/html2canvas-pro.esm.js.map +1 -1
- package/dist/html2canvas-pro.js +8 -2
- package/dist/html2canvas-pro.js.map +1 -1
- package/dist/html2canvas-pro.min.js +3 -3
- package/dist/lib/render/canvas/canvas-renderer.js +7 -1
- package/dist/lib/render/canvas/canvas-renderer.js.map +1 -1
- package/package.json +15 -15
|
@@ -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)));
|