blob: 309419be1aa5772e2851a23290c286039c607617 [file] [edit]
<!DOCTYPE html>
<html>
<body>
<canvas id="onscreen" width="200" height="200" style="width: 100px; height: 100px"></canvas>
<script>
const canvas = document.getElementById('onscreen');
const context = canvas.getContext('2d');
const square = new Path2D();
square.rect(50, 50, 100, 100);
context.fillStyle = 'red';
context.fill(square);
</script>
</body>
</html>