From 28e0d12d56df282e5086335ca80b0f0c6062f05f Mon Sep 17 00:00:00 2001 From: artashes-sanoyan Date: Tue, 22 Oct 2024 10:15:25 +0400 Subject: [PATCH] chore: update Truncate component, include letter-spacing in measurements --- src/Truncate/Truncate.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Truncate/Truncate.tsx b/src/Truncate/Truncate.tsx index 966eacc..8923410 100644 --- a/src/Truncate/Truncate.tsx +++ b/src/Truncate/Truncate.tsx @@ -64,7 +64,10 @@ export const Truncate: React.FC = ({ style.fontFamily, ].join(' ') - if (canvasContext) canvasContext.font = font + if (canvasContext) { + canvasContext.font = font + canvasContext.letterSpacing = style.letterSpacing + } setTargetWidth(newTargetWidth) }, [canvasContext, width])