摘要: canvas的旋转(rotate)是绕画布的左上角(0,0)开始旋转的,所以直接旋转无法得到想要的效果。 旋转的步骤: 1. 将(0, 0)偏移到物体的中心: ctx.translate(centerX, centerY); 2. 执行旋转: ctx.rotate(deg * Math.PI / 1 阅读全文
posted @ 2019-11-02 10:18 nowtd 阅读(2826) 评论(0) 推荐(1) 编辑