我需要自定义形状的文本输出。
我的代码:sceneFunc(context, shape) {
context.strokeStyle = "black";
context.font = (15 / shape.parent.scale().x).toFixed(0) + "px arial";
context.textBaseline = 'middle';
context.textAlign = 'center';
context.fillStyle = 'red';
context.beginPath();
context.strokeText("AAABBBCCC", shape.attrs.centerPoint.x, shape.attrs.centerPoint.y);
context.closePath();
context.fillStrokeShape(shape);
}
文本已正确呈现,但未填充。如何填写文本?