MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / hand

Function hand

app/rcc/scripts/painter/clock_face.js:70–78  ·  view source on GitHub ↗
(angle, length, width, color)

Source from the content-addressed store, hash-verified

68 const hour = (tod / 3600) % 12;
69
70 function hand(angle, length, width, color) {
71 ctx.strokeStyle = color;
72 ctx.lineWidth = width;
73 ctx.lineCap = "round";
74 ctx.beginPath();
75 ctx.moveTo(cx, cy);
76 ctx.lineTo(cx + Math.cos(angle) * length, cy + Math.sin(angle) * length);
77 ctx.stroke();
78 }
79
80 hand((hour / 12) * Math.PI * 2 - Math.PI / 2, r * 0.50, 6, theme.text);
81 hand((min / 60) * Math.PI * 2 - Math.PI / 2, r * 0.72, 4, theme.text);

Callers 1

paintFunction · 0.85

Calls 4

beginPathMethod · 0.80
moveToMethod · 0.80
lineToMethod · 0.80
strokeMethod · 0.80

Tested by

no test coverage detected