OLD | NEW |
| (Empty) |
1 description("Test that strokeText() doesn't produce a filled shadow."); | |
2 var ctx = document.createElement('canvas').getContext('2d'); | |
3 | |
4 ctx.fillStyle = 'green'; | |
5 ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height); | |
6 | |
7 // Stroke an 'I' with its shadow in the upper left corner. | |
8 ctx.strokeStyle = 'white'; | |
9 ctx.lineWidth = 2; | |
10 ctx.shadowColor = 'red'; | |
11 ctx.shadowOffsetX = -15; | |
12 ctx.shadowOffsetY = 0; | |
13 ctx.font = '128px sans-serif'; | |
14 ctx.strokeText("I", 0, 50); | |
15 | |
16 imageData = ctx.getImageData(0, 0, 1, 1); | |
17 imgdata = imageData.data; | |
18 shouldBe("imgdata[0]", "0"); | |
19 shouldBe("imgdata[1]", "128"); | |
20 shouldBe("imgdata[2]", "0"); | |
21 shouldBe("imgdata[3]", "255"); | |
OLD | NEW |