/*定义每次向下移动10个像素的变换矩阵*/ context.transform(1, 0, 0, 1, 0, 10); /*设定颜色*/ context.strokeStyle = colors[i]; /*绘制圆弧*/ context.beginPath(); context.arc(30, 110, 100, 0, Math.PI, true); context.stroke(); } }
/*定义每次向下移动10个像素的变换矩阵*/ context.transform(1, 0, 0, 1, 0, 10); /*设定颜色*/ context.strokeStyle = colors[i]; /*绘制圆弧*/ context.beginPath(); context.arc(30, 110, 100, 0, Math.PI, true); context.stroke(); } }