Voltaire // Giving a minimum width to cells.
- This is to make sure the width of the window won't be altered by the width differences of single candidate glyphs. - We choose a different approach to achieve this function here due to the UI design of the Voltaire Candidate Windows used in vChewing.
This commit is contained in:
parent
c9d077dfa4
commit
f32d1b82e4
|
@ -63,7 +63,11 @@ fileprivate class HorizontalCandidateView: NSView {
|
|||
let baseSize = NSSize(width: 10240.0, height: 10240.0)
|
||||
for index in 0..<count {
|
||||
let rctCandidate = (dispCandidatesWithLabels[index] as NSString).boundingRect(with: baseSize, options: .usesLineFragmentOrigin, attributes: candidateWithLabelAttrDict)
|
||||
let cellWidth = rctCandidate.size.width + cellPadding
|
||||
var cellWidth = rctCandidate.size.width + cellPadding
|
||||
let cellHeight = rctCandidate.size.height + cellPadding
|
||||
if cellWidth < cellHeight * 1.35 {
|
||||
cellWidth = cellHeight * 1.35
|
||||
}
|
||||
newWidths.append(cellWidth)
|
||||
}
|
||||
elementWidths = newWidths
|
||||
|
|
Loading…
Reference in New Issue