Fix analog positioning
This commit is contained in:
parent
2c90b77885
commit
3a765e01a8
4
clock.js
4
clock.js
@ -43,8 +43,8 @@
|
|||||||
// Position markers based on the current clock size
|
// Position markers based on the current clock size
|
||||||
// Move markers slightly inward and tweak the center position so
|
// Move markers slightly inward and tweak the center position so
|
||||||
// the ring of ticks lines up perfectly with the border.
|
// the ring of ticks lines up perfectly with the border.
|
||||||
const borderOffset = clock.offsetWidth > 300 ? 35 : 25;
|
const borderOffset = clock.offsetWidth > 300 ? 45 : 26;
|
||||||
const centerAdjust = { x: -1, y: -1 };
|
const centerAdjust = { x: -3, y: -2 };
|
||||||
const markerRadius = clock.offsetWidth / 2 - borderOffset;
|
const markerRadius = clock.offsetWidth / 2 - borderOffset;
|
||||||
markers.forEach((m, i) => {
|
markers.forEach((m, i) => {
|
||||||
const angle = (i / 16) * 2 * Math.PI;
|
const angle = (i / 16) * 2 * Math.PI;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user