Improve loads of fancy things in relation to the mouse pointer
This commit is contained in:
@@ -93,10 +93,13 @@ extension NSView {
|
||||
hitView(atWindowPoint: point)?.isDescendant(of: self) ?? false
|
||||
}
|
||||
|
||||
/// The visible rect minus the enclosing scroll view's scrollers, which keep the arrow.
|
||||
/// The visible rect minus the enclosing scroll view's scrollers and line-number ruler, which keep the arrow.
|
||||
/// The clip view runs under a visible ruler, so the visible rect alone would give the gutter the I-beam.
|
||||
var visibleRectWithoutScrollers: NSRect {
|
||||
let scrollers = [enclosingScrollView?.verticalScroller, enclosingScrollView?.horizontalScroller]
|
||||
return scrollers.compactMap { $0 }.filter { !$0.isHidden && $0.superview != nil }
|
||||
let scroll = enclosingScrollView
|
||||
let ruler: NSView? = scroll?.rulersVisible == true ? scroll?.verticalRulerView : nil
|
||||
let strips: [NSView?] = [scroll?.verticalScroller, scroll?.horizontalScroller, ruler]
|
||||
return strips.compactMap { $0 }.filter { !$0.isHidden && $0.superview != nil }
|
||||
.reduce(visibleRect) { $0.removing(convert($1.bounds, from: $1)) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user