@@ -293,9 +293,9 @@ html2canvas.prototype.finish = function(){
293293
294294html2canvas . prototype . drawBackground = function ( el , bounds , ctx ) {
295295
296-
297- var background_image = this . getCSS ( el , "background-image" ) ;
298- var background_repeat = this . getCSS ( el , "background-repeat" ) ;
296+ // TODO add support for multi background-images
297+ var background_image = this . getCSS ( el , "background-image" ) . split ( "," ) [ 0 ] ;
298+ var background_repeat = this . getCSS ( el , "background-repeat" ) . split ( "," ) [ 0 ] ;
299299
300300 if ( typeof background_image != "undefined" && / ^ ( 1 | n o n e ) $ / . test ( background_image ) == false && / ^ ( - w e b k i t | - m o z | l i n e a r - g r a d i e n t | - o - ) / . test ( background_image ) == false ) {
301301
@@ -457,7 +457,9 @@ html2canvas.prototype.backgroundImageUrl = function(src){
457457 */
458458
459459html2canvas . prototype . getBackgroundPosition = function ( el , bounds , image ) {
460- var bgpos = this . getCSS ( el , "backgroundPosition" ) || "0 0" ;
460+ // TODO add support for multi image backgrounds
461+
462+ var bgpos = this . getCSS ( el , "backgroundPosition" ) . split ( "," ) [ 0 ] || "0 0" ;
461463 // var bgpos = $(el).css("backgroundPosition") || "0 0";
462464 var bgposition = bgpos . split ( " " ) ,
463465 topPos ,
@@ -955,8 +957,8 @@ html2canvas.prototype.getImages = function(el) {
955957 var background_image = this . getCSS ( el , 'background-image' ) ;
956958
957959 if ( background_image && background_image != "1" && background_image != "none" && background_image . substring ( 0 , 7 ) != "-webkit" && background_image . substring ( 0 , 3 ) != "-o-" && background_image . substring ( 0 , 4 ) != "-moz" ) {
958-
959- var src = this . backgroundImageUrl ( background_image ) ;
960+ // TODO add multi image background support
961+ var src = this . backgroundImageUrl ( background_image . split ( "," ) [ 0 ] ) ;
960962 this . preloadImage ( src ) ;
961963 }
962964 }
@@ -1354,7 +1356,7 @@ html2canvas.prototype.canvasRenderer = function(queue){
13541356 * Sort elements based on z-index and position attributes
13551357 */
13561358
1357-
1359+ /*
13581360html2canvas.prototype.sortQueue = function(queue){
13591361 if (!this.opts.reorderZ || !this.needReorder) return queue;
13601362
@@ -1392,16 +1394,11 @@ html2canvas.prototype.sortQueue = function(queue){
13921394 });
13931395
13941396
1395- /*
13961397
1397- console.log('after');
1398- this.each(queue,function(i,e){
1399- console.log(i+":"+e.zIndex);
1400- // console.log(e.ctx.storage);
1401- }); */
14021398
14031399 return queue;
14041400}
1401+ */
14051402
14061403html2canvas . prototype . setContextVariable = function ( ctx , variable , value ) {
14071404 if ( ! ctx . storage ) {
@@ -1897,24 +1894,30 @@ html2canvas.prototype.sortZ = function(zStack){
18971894 subStacks . push ( stackChild ) ;
18981895 stackValues . push ( stackChild . zindex ) ;
18991896 } else {
1900- _ . queue . push ( stackChild ) ;
1897+
1898+
1899+ _ . queue . push ( stackChild ) ;
1900+
19011901 }
19021902
19031903 } ) ;
1904-
1905-
1906-
1907- stackValues . sort ( function ( a , b ) { return a - b } ) ;
1904+
1905+
1906+
1907+
1908+ stackValues . sort ( function ( a , b ) {
1909+ return a - b
1910+ } ) ;
19081911
19091912 this . each ( stackValues , function ( i , zValue ) {
1910- for ( var s = 0 ; s <= subStacks . length ; s ++ ) {
1911- if ( subStacks [ s ] . zindex == zValue ) {
1912- var stackChild = subStacks . splice ( s , 1 ) ;
1913- _ . sortZ ( stackChild [ 0 ] ) ;
1914- break ;
1913+ for ( var s = 0 ; s <= subStacks . length ; s ++ ) {
1914+ if ( subStacks [ s ] . zindex == zValue ) {
1915+ var stackChild = subStacks . splice ( s , 1 ) ;
1916+ _ . sortZ ( stackChild [ 0 ] ) ;
1917+ break ;
19151918
1916- }
1917- }
1919+ }
1920+ }
19181921
19191922 } ) ;
19201923
0 commit comments