     
     override init(frame frameRect: NSRect) {
         super.init(frame: frameRect)
-        self.wantsLayer = true
+        self.setup()
     }
 
     required public init?(coder: NSCoder) {
         super.init(coder: coder)
+        self.setup()
+    }
+    
+    func setup() {
         self.wantsLayer = true
+        
     }
     
     override open func viewWillMove(toWindow newWindow: NSWindow?) {

    }
    
    var manualScroll = false
//    @discardableResult open func scrollRectToVisible(_ aRect: NSRect, animated: Bool) -> Bool {
//        manualScroll = true
//        self.shouldAnimateOriginChange = animated
//        return super.scrollToVisible(aRect)
//    }
    
    @discardableResult open func scrollRectToVisible(_ rect: CGRect, animated: Bool, completion: AnimationCompletion? = nil) -> Bool {
        
        manualScroll = true
        shouldAnimateOriginChange = animated
        if animated == false {
            

        }
    }
    
    var _displayLink : CVDisplayLink?
    
    var displayLink : CVDisplayLink {
        if let link = _displayLink { return link }
        
        let linkCallback : CVDisplayLinkOutputCallback = {( displayLink, _, _, _, _, displayLinkContext) -> CVReturn in
            unsafeBitCast(displayLinkContext, to: ClipView.self).updateOrigin()
            return kCVReturnSuccess
        }
        var link : CVDisplayLink?
        CVDisplayLinkCreateWithActiveCGDisplays(&link)
        CVDisplayLinkSetOutputCallback(link!, linkCallback, UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))
        self._displayLink = link
        return link!
    }
    
    

    
    func updateCVDisplay(_ note: Notification) {
        
        guard self._displayLink != nil else { return }
        
        if let screen = self.window?.screen {
            let screenDictionary = screen.deviceDescription
            let screenID = screenDictionary["NSScreenNumber"] as! NSNumber
