This commit is contained in:
Niklas von Hertzen 2011-08-11 15:35:02 +03:00
parent dcd2a03f79
commit be241066ce
2 changed files with 20 additions and 19 deletions

View File

@ -289,7 +289,7 @@ html2canvas.prototype.canvasRenderer = function(queue){
* Sort elements based on z-index and position attributes * Sort elements based on z-index and position attributes
*/ */
/*
html2canvas.prototype.sortQueue = function(queue){ html2canvas.prototype.sortQueue = function(queue){
if (!this.opts.reorderZ || !this.needReorder) return queue; if (!this.opts.reorderZ || !this.needReorder) return queue;
@ -327,16 +327,11 @@ html2canvas.prototype.sortQueue = function(queue){
}); });
/*
console.log('after');
this.each(queue,function(i,e){
console.log(i+":"+e.zIndex);
// console.log(e.ctx.storage);
}); */
return queue; return queue;
} }
*/
html2canvas.prototype.setContextVariable = function(ctx,variable,value){ html2canvas.prototype.setContextVariable = function(ctx,variable,value){
if (!ctx.storage){ if (!ctx.storage){

View File

@ -168,24 +168,30 @@ html2canvas.prototype.sortZ = function(zStack){
subStacks.push(stackChild); subStacks.push(stackChild);
stackValues.push(stackChild.zindex); stackValues.push(stackChild.zindex);
}else{ }else{
_.queue.push(stackChild);
_.queue.push(stackChild);
} }
}); });
stackValues.sort(function(a,b){return a - b});
stackValues.sort(function(a,b){
return a - b
});
this.each(stackValues, function(i,zValue){ this.each(stackValues, function(i,zValue){
for (var s = 0;s<=subStacks.length;s++){ for (var s = 0;s<=subStacks.length;s++){
if (subStacks[s].zindex == zValue){ if (subStacks[s].zindex == zValue){
var stackChild = subStacks.splice(s,1); var stackChild = subStacks.splice(s,1);
_.sortZ(stackChild[0]); _.sortZ(stackChild[0]);
break; break;
} }
} }
}); });