summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/element/manual/transformations/canvas_transformations_reset_001.html
blob: c12acbf6f347a9a1a447e356b9ab47c5e51d4109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="match" href="canvas_transformations_reset_001-ref.html">
<style>
  html, body {
    margin: 0;
    padding: 0;
  }
</style>
<canvas id="c" width="150" height="150"></canvas>
<script>
var c = document.getElementById("c");
var ctx = c.getContext("2d");

ctx.translate(75, 75);
ctx.fillStyle = 'blue';
ctx.fillRect(0, 0, 75, 75);

ctx.resetTransform();
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, 75, 75);
</script>