clip()将当前的路径转换为裁剪路径
只能用一次,后续再用,不起作用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>day5-1</title>
<style type="text/css">
canvas{border:1px solid black;}
</style>
</head>
<body onload="draw()">
<canvas id="tutorial" width="150" height="150">
</canvas>
<script type="text/javascript">
function draw(){
var canvas = document.getElementById('tutorial')
if(canvas.getContext){//判断浏览器是否支持getContext属性
var ctx = canvas.getCon