diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index 18aee4c..7d57282 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -409,8 +409,6 @@ Context2d::PutImageData(const Arguments &args) { , sy = 0 , dx = args[1]->NumberValue() , dy = args[2]->NumberValue() - , dw - , dh , rows , cols; @@ -421,9 +419,9 @@ Context2d::PutImageData(const Arguments &args) { break; case 7: sx = args[3]->NumberValue(); - sx = args[4]->NumberValue(); - dw = args[5]->NumberValue(); - dh = args[6]->NumberValue(); + sy = args[4]->NumberValue(); + cols = args[5]->NumberValue(); + rows = args[6]->NumberValue(); break; default: return ThrowException(Exception::Error(String::New("invalid arguments"))); diff --git a/test/public/tests.js b/test/public/tests.js index 8a82524..dc86f43 100644 --- a/test/public/tests.js +++ b/test/public/tests.js @@ -1488,4 +1488,16 @@ tests['putImageData() 4'] = function(ctx){ } var data = ctx.getImageData(0,0,50,50); ctx.putImageData(data,30,30,10,10,30,30); +}; + +tests['putImageData() 5'] = function(ctx){ + for (i=0;i<6;i++){ + for (j=0;j<6;j++){ + ctx.fillStyle = 'rgb(' + Math.floor(255-42.5*i) + ',' + + Math.floor(255-42.5*j) + ',0)'; + ctx.fillRect(j*25,i*25,25,25); + } + } + var data = ctx.getImageData(0,0,50,50); + ctx.putImageData(data,60,60,30,10,50,30); }; \ No newline at end of file