     
     public override init(frame frameRect: NSRect) {
         super.init(frame: frameRect)
+        
+        self.addTrackingArea(NSTrackingArea(rect: self.bounds, options: [.mouseMoved, .activeInActiveApp, .inVisibleRect], owner: self, userInfo: nil))
         
         let pan = NSPanGestureRecognizer(target: self, action: #selector(handleGesture))
         pan.delegate = self

    
    required public init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func handleGesture(_ sender: NSPanGestureRecognizer) {

            drawPoint(context, p2)
            drawPoint(context, p3)
            
            if let (t1, t2) = CubicBezierSelfIntersect(p0, p1, p2, p3) {
                
                context.setStrokeColor(NSColor.red.cgColor)
