Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <canvas width="100" height="100" id="c"></canvas> |
michael@0 | 3 | <script> |
michael@0 | 4 | window.onload = function () { |
michael@0 | 5 | var ctx = document.getElementById('c').getContext('2d'); |
michael@0 | 6 | |
michael@0 | 7 | ctx.beginPath(); |
michael@0 | 8 | ctx.moveTo(0, 0); |
michael@0 | 9 | ctx.lineTo(0, 100); |
michael@0 | 10 | ctx.lineTo(100, 100); |
michael@0 | 11 | |
michael@0 | 12 | ctx.fillStyle = '#f00'; |
michael@0 | 13 | ctx.strokeStyle = '#00f'; |
michael@0 | 14 | |
michael@0 | 15 | ctx.fillRect(30, 10, 10, 10); |
michael@0 | 16 | ctx.strokeRect(60, 10, 10, 10); |
michael@0 | 17 | ctx.clearRect(25, 15, 50, 10); |
michael@0 | 18 | ctx.drawImage(document.getElementById('c'), 0, 0); |
michael@0 | 19 | if (ctx.putImageData) ctx.putImageData(ctx.getImageData(0, 0, 10, 10), 0, 0); |
michael@0 | 20 | |
michael@0 | 21 | ctx.lineTo(100, 0); |
michael@0 | 22 | ctx.fillStyle = '#0f0'; |
michael@0 | 23 | ctx.fill(); |
michael@0 | 24 | } |
michael@0 | 25 | </script> |