Dokumentation zur WeChat-Applet-Entwicklung
/ 微信小程序API 繪圖對坐標(biāo)軸進行順時針旋轉(zhuǎn)
微信小程序API 繪圖對坐標(biāo)軸進行順時針旋轉(zhuǎn)
rotate
定義
以原點為中心,原點可以用 translate方法修改。順時針旋轉(zhuǎn)當(dāng)前坐標(biāo)軸。多次調(diào)用rotate
,旋轉(zhuǎn)的角度會疊加。
參數(shù)
const ctx = wx.createCanvasContext('myCanvas') ctx.strokeRect(100, 10, 150, 100) ctx.rotate(20 * Math.PI / 180) ctx.strokeRect(100, 10, 150, 100) ctx.rotate(20 * Math.PI / 180) ctx.strokeRect(100, 10, 150, 100) ctx.draw()