HTML5 中畫布旋轉後檢測畫布上點的步驟


每當使用畫布並希望旋轉該畫布時,都需要轉換點來繪製與其旋轉相關的點。

可在畫布旋轉後建立轉換類以檢測畫布上的點

var t = new Transform();
console.log(t.transformPoint(5,6)); //Transform point will be [5,6]

t.rotate(1); // Same transformations can be applied that we did to the canvas
console.log(t.transformPoint(5,6)); // Transformed point will be [-2.347, 7.449]

更新日期:2020 年 1 月 30 日

225 次瀏覽

開啟你的 職業生涯

透過完成該課程獲得認證

開始
廣告
© . All rights reserved.