blob: d2894fe3a5c973ed5a853ff595d930a2c75828fa [file] [edit]
<!DOCTYPE html>
<html>
<body>
<canvas id="onscreen" width="200" height="200" style="border: 1px solid black; clip-path: circle(30%); background-color:blue; will-change:transform"></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>