我正在尝试在html画布中绘制弯曲的箭头.我没有问题画一条曲线,但我不知道怎么把它放>在线的末端(方向).
ctx.beginPath();
ctx.fillStyle = "rgba(55, 217, 56,"+ opacity +")";
ctx.moveTo(this.fromX,this.fromY);
ctx.quadraticCurveTo(this.controlX, this.controlY, this.toX, this.toY);
ctx.stroke();
Run Code Online (Sandbox Code Playgroud)
我的想法是在最后占据一小部分线并绘制一个三角形.如何获得线中某点的坐标?
以下是更好理解的图像.