From 9ad145df35a8c7436cf0836bbf511f4053f059da Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 29 May 2022 15:19:30 +0800 Subject: [PATCH] Voltaire // Round windowWidth in ctlCandidateHorizontal. --- Source/UI/CandidateUI/ctlCandidateHorizontal.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/UI/CandidateUI/ctlCandidateHorizontal.swift b/Source/UI/CandidateUI/ctlCandidateHorizontal.swift index d2c9b581..b46869a8 100644 --- a/Source/UI/CandidateUI/ctlCandidateHorizontal.swift +++ b/Source/UI/CandidateUI/ctlCandidateHorizontal.swift @@ -52,8 +52,7 @@ private class HorizontalCandidateView: NSView { var result = NSSize.zero if !elementWidths.isEmpty { - result.width = elementWidths.reduce(0, +) - result.width += CGFloat(elementWidths.count) + result.width = elementWidths.reduce(0, +) + CGFloat(elementWidths.count) result.height = candidateTextHeight + cellPadding } return result @@ -78,7 +77,7 @@ private class HorizontalCandidateView: NSView { if cellWidth < cellHeight * 1.35 { cellWidth = cellHeight * 1.35 } - newWidths.append(cellWidth) + newWidths.append(round(cellWidth)) } elementWidths = newWidths }