Skip to content

Commit 0b213ee

Browse files
committed
Fix bug in WebKitGTK+, backgroundRepeat return "wrong" values
1 parent 1d4b175 commit 0b213ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Core.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ _html2canvas.Util.getCSS = function (element, attribute, index) {
250250
}
251251

252252
var value = computedCSS[attribute];
253+
if(attribute==="backgroundRepeat" && value.indexOf(" ")!==-1){
254+
value = (
255+
"no-repeat repeat"===value ? "repeat-y" : (
256+
"repeat no-repeat"===value ? "repeat-x" : value
257+
)
258+
);
259+
}
253260

254261
if (/^background(Size|Position)$/.test(attribute)) {
255262
return parseBackgroundSizePosition(value, element, attribute, index);
@@ -406,4 +413,4 @@ _html2canvas.Util.Children = function( elem ) {
406413

407414
_html2canvas.Util.isTransparent = function(backgroundColor) {
408415
return (!backgroundColor || backgroundColor === "transparent" || backgroundColor === "rgba(0, 0, 0, 0)");
409-
};
416+
};

0 commit comments

Comments
 (0)