Rotate RPG clock: 6:00 real at bottom (0°), midnight at left
This commit is contained in:
1 parent
1b5fcf74b5
commit
79ceaa1673
1 file changed
+2
-1
+2
-1
@@ -338,7 +338,8 @@
|
||||
}
|
||||
|
||||
function angleForTime(date) {
|
||||
var hours = date.getHours() + date.getMinutes() / 60;
|
||||
// Rotate so 6:00 real = bottom (0°), 12:00 = right (90°), 18:00 = top (180°), 0:00 = left (270°)
|
||||
var hours = (date.getHours() + date.getMinutes() / 60 - 6 + 24) % 24;
|
||||
return ((hours / 24) * 360 - 90) * Math.PI / 180;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user