Skip to content

Commit 5b4a6c2

Browse files
committed
Add another border-radius test
1 parent 364a8aa commit 5b4a6c2

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

dist/html2canvas.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,14 +3418,14 @@ function calculateCurvePoints(bounds, borderRadius, borders) {
34183418
width = bounds.width,
34193419
height = bounds.height,
34203420

3421-
tlh = borderRadius[0][0],
3422-
tlv = borderRadius[0][1],
3423-
trh = borderRadius[1][0],
3424-
trv = borderRadius[1][1],
3425-
brh = borderRadius[2][0],
3426-
brv = borderRadius[2][1],
3427-
blh = borderRadius[3][0],
3428-
blv = borderRadius[3][1];
3421+
tlh = borderRadius[0][0] < width / 2 ? borderRadius[0][0] : width / 2,
3422+
tlv = borderRadius[0][1] < height / 2 ? borderRadius[0][1] : height / 2,
3423+
trh = borderRadius[1][0] < width / 2 ? borderRadius[1][0] : width / 2,
3424+
trv = borderRadius[1][1] < height / 2 ? borderRadius[1][1] : height / 2,
3425+
brh = borderRadius[2][0] < width / 2 ? borderRadius[2][0] : width / 2,
3426+
brv = borderRadius[2][1] < height / 2 ? borderRadius[2][1] : height / 2,
3427+
blh = borderRadius[3][0] < width / 2 ? borderRadius[3][0] : width / 2,
3428+
blv = borderRadius[3][1] < height / 2 ? borderRadius[3][1] : height / 2;
34293429

34303430
var topWidth = width - trh,
34313431
rightHeight = height - brv,

0 commit comments

Comments
 (0)