     
     required public init?(coder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
+    }
+    
+    public override func mouseMoved(with event: NSEvent) {
+        
+        q = Point(self.convert(event.locationInWindow, from: nil))
+        
+        super.mouseMoved(with: event)
     }
     
     func handleGesture(_ sender: NSPanGestureRecognizer) {

    
    public override init(frame frameRect: NSRect) {
        super.init(frame: frameRect)
        
        let pan = NSPanGestureRecognizer(target: self, action: #selector(handleGesture))
        pan.delegate = self

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