이것이 중복되는 경우 매우 유감스럽게 생각합니다. 요청을 마치고, 대답을 먼저 한 후 .. 내 머리가 내 머리카락에서 ..html 캔버스, mousedown으로 중심 주위에 캔버스 회전
왜 아무것도 아닌가? 제발 새로운 .html 캔버스와 .js 도와주세요.
<!DOCTYPE html>
<html>
<body>
<canvas id="r" width="300" height="150" style="border:solid></canvas>
<script>
var ctx=document.getElementById("r").getContext("2d");
ctx.beginPath();
ctx.fillRect(50,20,100,50);
function roc(){//rotate on click
ctx.translate(r.width/2,r.height/2);
ctx.rotate(20*Math.PI/180);
}r.addEventListener("mousedown",roc)
</script>
</body>
</html>