blob: d768c02b25a82e45cd8cb9e7120d2655d55f33d5 [file] [log] [blame]
<!DOCTYPE html>
<body>
<canvas id="canvas" width="400" height="800"></canvas>
</body>
<script>
var canvas = document.getElementById('canvas');
canvas.style.width = (canvas.width / 2) + 'px';
canvas.style.height = (canvas.height / 2) + 'px';
var ctx = canvas.getContext('2d');
ctx.scale(2, 2);
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 100, 150);
ctx.fillStyle = 'red';
ctx.fillRect(0, 150, 200, 250);
</script>