diff options
Diffstat (limited to 'Base/home/anon/www')
-rw-r--r-- | Base/home/anon/www/canvas.html | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Base/home/anon/www/canvas.html b/Base/home/anon/www/canvas.html index b82f553315..8d277ae9b8 100644 --- a/Base/home/anon/www/canvas.html +++ b/Base/home/anon/www/canvas.html @@ -16,8 +16,20 @@ canvas { <script> document.addEventListener("DOMContentLoaded", function() { ctx = document.getElementById("foo").getContext("2d"); - ctx.fillStyle = 'red'; - ctx.fillRect(10, 10, 200, 100); + + var width = 200; + var height = 100; + for (var i = 0; i < 2; i++) + { + ctx.fillStyle = 'red'; + ctx.fillRect(10, 10, width, height); + + ctx.strokeStyle = 'blue'; + ctx.strokeRect(10, 10, width, height); + + ctx.scale(0.5, 0.5); + ctx.translate(10 + width * 2, 10 + height * 2); + } }); </script> </head> |