Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0 RC 2, 5.0.2
-
None
-
Linux x86_64
-
1b284d5f3491a24649d1c1e6d2746a00a513ed78
Description
var ctx = canvas.getContext('2d'); ctx.save(); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.strokeStyle = 'white' ctx.lineWidth = 5; ctx.rotate(0.15) ctx.translate(100, 100); ctx.beginPath(); ctx.moveTo(100, 100); ctx.lineTo(300, 100); ctx.stroke(); ctx.fillStyle = 'steelblue' ctx.font = '20px sansserif' ctx.fillText('underlined text', 0, 0); ctx.restore();
The transformation is not accumulated correctly:
- The line is positioned at 100,100 and should be 100 pixels away from the text
- The text and the line should have the same angle.