fix: subtract

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-04-13 15:16:01 +00:00 committed by GitHub
parent bef8ecdf45
commit 2ef4afaafc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,6 +92,7 @@ const hHandLengthRatio = 0.75;
const mHandLengthRatio = 1; const mHandLengthRatio = 1;
const sHandLengthRatio = 1; const sHandLengthRatio = 1;
const numbersOpacityFactor = 0.35; const numbersOpacityFactor = 0.35;
const thisYearValue = new Date(new Date().getFullYear(), 0).valueOf();
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
thickness?: number; thickness?: number;
@ -159,7 +160,7 @@ function tick() {
} }
hAngle = Math.PI * (h % (props.twentyfour ? 24 : 12) + (m + s / 60) / 60) / (props.twentyfour ? 12 : 6); hAngle = Math.PI * (h % (props.twentyfour ? 24 : 12) + (m + s / 60) / 60) / (props.twentyfour ? 12 : 6);
mAngle = Math.PI * (m + s / 60) / 30; mAngle = Math.PI * (m + s / 60) / 30;
sAngle = Math.PI * Math.floor(now.valueOf() / 1000) / 30; // NOTE: UNIX sAngle = Math.PI * Math.floor((now.valueOf() - thisYearValue) / 1000) / 30; // NOTE: UNIX
} }
tick(); tick();