canvas 绘制任意弧度圆
demo图
save和restore方法
ctx.strokeStyle = "red"; // 线条色为red
// 使用save
ctx.save(); // 局部属性,只在下一个restore之中有效
ctx.strokeStyle = "blue"; // 线条色为red
ctx.restore();
// 在使用strokeStyle为red
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>canvas任意弧度的圆</title>
<style>
.canvas-wrap {
width: 500px;
height: 550px;