Skip to content

Commit

Permalink
Fix user label placement
Browse files Browse the repository at this point in the history
  • Loading branch information
anadis504 committed Mar 29, 2024
1 parent f623de2 commit 984d2c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/PdfDownload/PdfGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const PDFSumFactorReport: React.FC<React.PropsWithChildren<SubmissionProps>> = (
const userLabel: string = userName ?? userVar?.label ?? "Your Score"
const userPlacement =
(100 * (-(start as number) + userScore)) / ((finnish as number) - (start as number))
const userLabelWidth = (100 * getTextWidth(userLabel, "15px Raleway")) / 100
const userLabelWidth = getTextWidth(userLabel, "9px Raleway")
const labelPlacement =
userPlacement >= 100 - userLabelWidth ? userPlacement - userLabelWidth - 4 : userPlacement + 4
return (
Expand Down

0 comments on commit 984d2c3

Please sign in to comment.