Find current point on path for HTML Canvas context?

后端 未结 1 454
眼角桃花
眼角桃花 2021-01-04 12:43

If I have an HTML Canvas context and do:

ctx.beginPath();
ctx.moveTo(10,10);
ctx.lineTo(20,30);
ctx.closePath();
ctx.stroke();

...a line is

相关标签:
1条回答
  • 2021-01-04 13:24

    As far as I know there's no direct way to access arguments passed to various ctx methods (ie. moveTo in this case). You can wrap the Context API into a class of its own to do this, however. See [1] and [2] for reference.

    0 讨论(0)
提交回复
热议问题