mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibWeb: Add CanvasRenderingContext2D.rotate()
This is pretty limited since we don't have wholesale mapping through the context transform, but we have to start somewhere. :^)
This commit is contained in:
parent
dc22e59a1a
commit
9d8565cf9a
5 changed files with 21 additions and 0 deletions
12
Base/res/html/misc/canvas-rotate.html
Normal file
12
Base/res/html/misc/canvas-rotate.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<html>
|
||||
<canvas id=c width=200 height=200></canvas>
|
||||
<script>
|
||||
c = document.getElementById('c');
|
||||
x = c.getContext('2d');
|
||||
x.strokeStyle = 'black';
|
||||
for (i = 0; i < 8; ++i) {
|
||||
x.strokeRect(50, 50, 50, 50);
|
||||
x.rotate(0.05);
|
||||
}
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue