| | |
| | | |
| | | private func spaceLaneSegment(at windowLocation: CGPoint) -> SpaceLaneSegmentLayers? { |
| | | let locationInView = convert(windowLocation, from: nil) |
| | | |
| | | // 严格 band 检查:只有鼠标在 lane 的垂直 band 内才考虑是 lane hover。 |
| | | // 防止“完全空的地方”(y 不在 lane 高度范围内)误 hit 到 segment frame, |
| | | // 导致 hoveredSpaceLaneID 粘住、activeSpaceFocusID 非 nil、窗口 spaceFocused 高亮。 |
| | | let laneMinYInView = glassLayer.frame.minY + laneLayer.frame.minY |
| | | let laneMaxYInView = laneMinYInView + laneLayer.frame.height |
| | | if locationInView.y < laneMinYInView || locationInView.y > laneMaxYInView { |
| | | return nil |
| | | } |
| | | |
| | | let locationInSpaceLaneContent = CGPoint( |
| | | x: locationInView.x - glassLayer.frame.minX - laneLayer.frame.minX - spaceLaneContentLayer.frame.minX, |
| | | y: locationInView.y - glassLayer.frame.minY - laneLayer.frame.minY - spaceLaneContentLayer.frame.minY |