Skip to content

Commit e7d6a69

Browse files
committed
Fixes "Large border radius" bug in chrome
1 parent 517fd8c commit e7d6a69

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/Parse.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,19 @@ _html2canvas.Parse = function (images, options, cb) {
681681
brh = borderRadius[2][0],
682682
brv = borderRadius[2][1],
683683
blh = borderRadius[3][0],
684-
blv = borderRadius[3][1],
685-
686-
topWidth = width - trh,
684+
blv = borderRadius[3][1];
685+
686+
var halfHeight = Math.floor(height / 2);
687+
tlh = tlh > halfHeight ? halfHeight : tlh;
688+
tlv = tlv > halfHeight ? halfHeight : tlv;
689+
trh = trh > halfHeight ? halfHeight : trh;
690+
trv = trv > halfHeight ? halfHeight : trv;
691+
brh = brh > halfHeight ? halfHeight : brh;
692+
brv = brv > halfHeight ? halfHeight : brv;
693+
blh = blh > halfHeight ? halfHeight : blh;
694+
blv = blv > halfHeight ? halfHeight : blv;
695+
696+
var topWidth = width - trh,
687697
rightHeight = height - brv,
688698
bottomWidth = width - brh,
689699
leftHeight = height - blv;

0 commit comments

Comments
 (0)