Skip to content

Commit

Permalink
Fix: Resolve issue with zero lines
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltySalt77 committed Jan 3, 2024
1 parent 4285364 commit adf1f1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/hitchhiking/panel/HitchhikingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ const HitchhikingCardBack = ({
const { isPc } = useMedia()

const getHeight = (originHeight: number) => {
return `${Math.floor((cardWidth * originHeight) / 328 / 16)}rem`
return `${(cardWidth * originHeight) / 328 / 16}rem`
}

const getLineCount = (originHeight: number, lineHeight: number) => {
return Math.floor((cardWidth * originHeight) / 328 / lineHeight)
const lineCount = Math.floor((cardWidth * originHeight) / 328 / lineHeight)
return lineCount ? lineCount : 1
}

useEffect(() => {
Expand Down

0 comments on commit adf1f1d

Please sign in to comment.