OLD | NEW |
1 // Logs the size of the geometry to the console. | 1 // Logs the size of the geometry to the console. |
2 // Fills the context with a green square. | 2 // Fills the context with a green square. |
3 | 3 |
4 registerPaint('logging-green', class { | 4 registerPaint('logging-green', class { |
5 paint(ctx, geom) { | 5 paint(ctx, geom) { |
6 console.log('width: ' + geom.width + ', height: ' + geom.height); | 6 console.log('width: ' + geom.width + ', height: ' + geom.height); |
7 ctx.fillStyle = 'green'; | 7 ctx.fillStyle = 'green'; |
8 ctx.fillRect(0, 0, geom.width, geom.height); | 8 ctx.fillRect(0, 0, geom.width, geom.height); |
9 } | 9 } |
10 }); | 10 }); |
OLD | NEW |