Skip to content

Commit

Permalink
Correctly clip content that has border-radius (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasvh committed Oct 7, 2014
1 parent 6073928 commit 5712b62
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dist/html2canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,9 @@ NodeParser.prototype.paintNode = function(container) {

this.renderer.clip(container.clip, function() {
this.renderer.renderBorders(container.borders.borders);
}, this);

this.renderer.clip(container.backgroundClip, function() {
switch (container.node.nodeName) {
case "svg":
case "IFRAME":
Expand Down
2 changes: 1 addition & 1 deletion dist/html2canvas.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/nodeparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ NodeParser.prototype.paintNode = function(container) {

this.renderer.clip(container.clip, function() {
this.renderer.renderBorders(container.borders.borders);
}, this);

this.renderer.clip(container.backgroundClip, function() {
switch (container.node.nodeName) {
case "svg":
case "IFRAME":
Expand Down
1 change: 1 addition & 0 deletions tests/cases/images/images.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<img src="../../assets/image.jpg" />
<img src="../../assets/image.jpg" style="width:50px;height:400px;" />
<img src="../../assets/image.jpg" style="width:500px;" />
<img src="../../assets/image.jpg" style="width:100px;border-radius:50px;" />
<img src="../../assets/image.jpg" style="width:500px;height:40px;" />


Expand Down

0 comments on commit 5712b62

Please sign in to comment.