about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-02-09 12:04:04 -0600
committerGitHub <noreply@github.com>2024-02-09 12:04:04 -0600
commit071efaf2dfb2d077e5e60193f083676ec726cba6 (patch)
treee6288ac3193de276eb6d09c91509121e2b514bfc /src
parentd6235453c9b5f297b95edd58864fe26268239318 (diff)
downloadvoidsky-071efaf2dfb2d077e5e60193f083676ec726cba6.tar.zst
Round line height (#2824)
* Round line height

* Add to existing
Diffstat (limited to 'src')
-rw-r--r--src/components/Typography.tsx4
-rw-r--r--src/lib/styles.ts2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/components/Typography.tsx b/src/components/Typography.tsx
index 8136b5ef3..b34f51018 100644
--- a/src/components/Typography.tsx
+++ b/src/components/Typography.tsx
@@ -15,7 +15,7 @@ export function leading<
 >(textSize: Size, leading: Leading) {
   const size = textSize?.fontSize || atoms.text_md.fontSize
   const lineHeight = leading?.lineHeight || atoms.leading_normal.lineHeight
-  return size * lineHeight
+  return Math.round(size * lineHeight)
 }
 
 /**
@@ -32,7 +32,7 @@ function normalizeTextStyles(styles: TextStyle[]) {
 
   if (s?.lineHeight) {
     if (s.lineHeight <= 2) {
-      s.lineHeight = fontSize * s.lineHeight
+      s.lineHeight = Math.round(fontSize * s.lineHeight)
     }
   } else {
     s.lineHeight = fontSize
diff --git a/src/lib/styles.ts b/src/lib/styles.ts
index df9b49260..263127440 100644
--- a/src/lib/styles.ts
+++ b/src/lib/styles.ts
@@ -236,7 +236,7 @@ export function lh(
   height: number,
 ): TextStyle {
   return {
-    lineHeight: (theme.typography[type].fontSize || 16) * height,
+    lineHeight: Math.round((theme.typography[type].fontSize || 16) * height),
   }
 }