Skip to content

Commit fee9b13

Browse files
committed
[Fix] Optimize label vertical alignment
Fix #920
1 parent 7fbc911 commit fee9b13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sources/SquirrelTheme.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,22 @@ final class SquirrelTheme {
116116
private(set) lazy var labelAttrs: [NSAttributedString.Key: Any] = [
117117
.foregroundColor: candidateLabelColor ?? blendColor(foregroundColor: self.candidateTextColor, backgroundColor: self.backgroundColor),
118118
.font: labelFont,
119-
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2 : 0)
119+
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2.5 : 0)
120120
]
121121
private(set) lazy var labelHighlightedAttrs: [NSAttributedString.Key: Any] = [
122122
.foregroundColor: highlightedCandidateLabelColor ?? blendColor(foregroundColor: highlightedCandidateTextColor, backgroundColor: highlightedBackColor),
123123
.font: labelFont,
124-
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2 : 0)
124+
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - labelFont.pointSize) / 2.5 : 0)
125125
]
126126
private(set) lazy var commentAttrs: [NSAttributedString.Key: Any] = [
127127
.foregroundColor: commentTextColor ?? candidateTextColor,
128128
.font: commentFont,
129-
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2 : 0)
129+
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2.5 : 0)
130130
]
131131
private(set) lazy var commentHighlightedAttrs: [NSAttributedString.Key: Any] = [
132132
.foregroundColor: highlightedCommentTextColor ?? highlightedCandidateTextColor,
133133
.font: commentFont,
134-
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2 : 0)
134+
.baselineOffset: baseOffset + (!vertical ? (font.pointSize - commentFont.pointSize) / 2.5 : 0)
135135
]
136136
private(set) lazy var preeditAttrs: [NSAttributedString.Key: Any] = [
137137
.foregroundColor: textColor,

0 commit comments

Comments
 (0)