Voltaire // Use Swift-specific iterators in certain context.
This commit is contained in:
parent
1ab378ebd2
commit
acfe46daef
|
@ -129,8 +129,8 @@ private class HorizontalCandidateView: NSView {
|
||||||
)
|
)
|
||||||
|
|
||||||
var accuWidth: CGFloat = 0
|
var accuWidth: CGFloat = 0
|
||||||
for index in 0..<elementWidths.count {
|
for (index, elementWidth) in elementWidths.enumerated() {
|
||||||
let currentWidth = elementWidths[index]
|
let currentWidth = elementWidth
|
||||||
let rctCandidateArea = NSRect(
|
let rctCandidateArea = NSRect(
|
||||||
x: accuWidth, y: 0.0, width: currentWidth + 1.0,
|
x: accuWidth, y: 0.0, width: currentWidth + 1.0,
|
||||||
height: candidateTextHeight + cellPadding
|
height: candidateTextHeight + cellPadding
|
||||||
|
@ -203,8 +203,8 @@ private class HorizontalCandidateView: NSView {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var accuWidth: CGFloat = 0.0
|
var accuWidth: CGFloat = 0.0
|
||||||
for index in 0..<elementWidths.count {
|
for (index, elementWidth) in elementWidths.enumerated() {
|
||||||
let currentWidth = elementWidths[index]
|
let currentWidth = elementWidth
|
||||||
|
|
||||||
if location.x >= accuWidth, location.x <= accuWidth + currentWidth {
|
if location.x >= accuWidth, location.x <= accuWidth + currentWidth {
|
||||||
return UInt(index)
|
return UInt(index)
|
||||||
|
|
|
@ -135,8 +135,8 @@ private class VerticalCandidateView: NSView {
|
||||||
)
|
)
|
||||||
|
|
||||||
var accuHeight: CGFloat = 0
|
var accuHeight: CGFloat = 0
|
||||||
for index in 0..<elementHeights.count {
|
for (index, elementHeight) in elementHeights.enumerated() {
|
||||||
let currentHeight = elementHeights[index]
|
let currentHeight = elementHeight
|
||||||
let rctCandidateArea = NSRect(
|
let rctCandidateArea = NSRect(
|
||||||
x: 0.0, y: accuHeight, width: windowWidth, height: candidateTextHeight + cellPadding
|
x: 0.0, y: accuHeight, width: windowWidth, height: candidateTextHeight + cellPadding
|
||||||
)
|
)
|
||||||
|
@ -207,8 +207,8 @@ private class VerticalCandidateView: NSView {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var accuHeight: CGFloat = 0.0
|
var accuHeight: CGFloat = 0.0
|
||||||
for index in 0..<elementHeights.count {
|
for (index, elementHeight) in elementHeights.enumerated() {
|
||||||
let currentHeight = elementHeights[index]
|
let currentHeight = elementHeight
|
||||||
|
|
||||||
if location.y >= accuHeight, location.y <= accuHeight + currentHeight {
|
if location.y >= accuHeight, location.y <= accuHeight + currentHeight {
|
||||||
return UInt(index)
|
return UInt(index)
|
||||||
|
|
Loading…
Reference in New Issue