From fee9b137bf95cc01202cb8d3cc9d91002b7cd0c4 Mon Sep 17 00:00:00 2001 From: LEO Yoon-Tsaw Date: Sat, 1 Jun 2024 10:52:17 -0400 Subject: [PATCH] [Fix] Optimize label vertical alignment Fix #920 --- sources/SquirrelTheme.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/SquirrelTheme.swift b/sources/SquirrelTheme.swift index 82e686377..401e28ea3 100644 --- a/sources/SquirrelTheme.swift +++ b/sources/SquirrelTheme.swift @@ -116,22 +116,22 @@ final class SquirrelTheme { private(set) lazy var labelAttrs: [NSAttributedString.Key: Any] = [ .foregroundColor: candidateLabelColor ?? blendColor(foregroundColor: self.candidateTextColor, backgroundColor: self.backgroundColor), .font: labelFont, - .baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2 : 0) + .baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2.5 : 0) ] private(set) lazy var labelHighlightedAttrs: [NSAttributedString.Key: Any] = [ .foregroundColor: highlightedCandidateLabelColor ?? blendColor(foregroundColor: highlightedCandidateTextColor, backgroundColor: highlightedBackColor), .font: labelFont, - .baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2 : 0) + .baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2.5 : 0) ] private(set) lazy var commentAttrs: [NSAttributedString.Key: Any] = [ .foregroundColor: commentTextColor ?? candidateTextColor, .font: commentFont, - .baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2 : 0) + .baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2.5 : 0) ] private(set) lazy var commentHighlightedAttrs: [NSAttributedString.Key: Any] = [ .foregroundColor: highlightedCommentTextColor ?? highlightedCandidateTextColor, .font: commentFont, - .baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2 : 0) + .baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2.5 : 0) ] private(set) lazy var preeditAttrs: [NSAttributedString.Key: Any] = [ .foregroundColor: textColor,