Skip to content

Commit

Permalink
[Fix] Optimize label vertical alignment
Browse files Browse the repository at this point in the history
Fix #920
  • Loading branch information
LEOYoon-Tsaw committed Jun 1, 2024
1 parent 7fbc911 commit fee9b13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sources/SquirrelTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fee9b13

Please sign in to comment.