Skip to content

Commit

Permalink
chore: update Truncate component, include letter-spacing in measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
artashes-sanoyan committed Oct 22, 2024
1 parent 9abe0d8 commit 28e0d12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Truncate/Truncate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export const Truncate: React.FC<TruncateProps> = ({
style.fontFamily,
].join(' ')

if (canvasContext) canvasContext.font = font
if (canvasContext) {
canvasContext.font = font
canvasContext.letterSpacing = style.letterSpacing
}

setTargetWidth(newTargetWidth)
}, [canvasContext, width])
Expand Down

0 comments on commit 28e0d12

Please sign in to comment.