fixes cursor
This commit is contained in:
@@ -54,7 +54,7 @@ private struct SplitterHandle: NSViewRepresentable {
|
||||
}
|
||||
}
|
||||
|
||||
final class SplitterHandleView: NSView {
|
||||
final class SplitterHandleView: NSView, PointerOwner {
|
||||
var axis: Axis = .vertical {
|
||||
didSet { if axis != oldValue { window?.invalidateCursorRects(for: self) } }
|
||||
}
|
||||
@@ -86,6 +86,10 @@ final class SplitterHandleView: NSView {
|
||||
cursor.set()
|
||||
}
|
||||
|
||||
func updatePointer(atWindowPoint point: NSPoint) {
|
||||
cursor.set()
|
||||
}
|
||||
|
||||
override func mouseEntered(with event: NSEvent) {
|
||||
onHover(true)
|
||||
cursor.set()
|
||||
@@ -117,8 +121,12 @@ final class SplitterHandleView: NSView {
|
||||
override func mouseUp(with event: NSEvent) {
|
||||
guard dragStart != nil else { return }
|
||||
let inside = bounds.contains(convert(event.locationInWindow, from: nil))
|
||||
(inside ? cursor : NSCursor.arrow).set()
|
||||
endDrag()
|
||||
if inside {
|
||||
cursor.set()
|
||||
} else if let window {
|
||||
PointerPolicy.updateCursor(in: window)
|
||||
}
|
||||
onHover(inside)
|
||||
onEnd()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user