disable use of path2d in node

pull/280/head
Vladimir Mandic 2021-11-09 18:10:54 -05:00
parent 4ed8c9c190
commit 7a1707cf18
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,8 @@
### **HEAD -> main** 2021/11/09 mandic00@live.com
- add liveness module and facerecognition demo
- initial version of facerecognition demo
- rebuild
- add type defs when working with relative path imports
- disable humangl backend if webgl 1.0 is detected

View File

@ -278,7 +278,7 @@ export async function face(inCanvas: AnyCanvas, result: Array<FaceResult>, drawO
ctx.fill();
}
}
if (localOptions.drawGaze && f.rotation?.angle) {
if (localOptions.drawGaze && f.rotation?.angle && typeof Path2D !== 'undefined') {
ctx.strokeStyle = 'pink';
const valX = (f.box[0] + f.box[2] / 2) - (f.box[3] * rad2deg(f.rotation.angle.yaw) / 90);
const valY = (f.box[1] + f.box[3] / 2) + (f.box[2] * rad2deg(f.rotation.angle.pitch) / 90);