         scene.setup(self.isPreview, width: self.width(), height: self.height())
         super.startAnimation()
         animationTimeInterval = 1.0 / scene.fps
-        needsDisplay = true
+        self.window?.backingType = .nonretained // an attempt to stop the double-buffering, which doesn't work
     }
         
-    override func animateOneFrame()
-    {
-        let context = window!.graphicsContext
-        NSGraphicsContext.current = context
-        
+    override public func draw(_ rect: NSRect) {
         if animState == "fade"
         {
             fadeOut()

        draw(bounds)
    }
    
    override func draw(_ rect: NSRect)
    {
        let bPath:NSBezierPath = NSBezierPath(rect: rect)
        bPath.fill()
    }
    override var configureSheet: NSWindow? { return sheetController.window }
    override var hasConfigureSheet: Bool { return true }
    func width() -> Int { return Int(bounds.size.width) }
    func height() -> Int { return Int(bounds.size.height) }
}

                animState = "fade"
                fadeCount = 0
            }
            else
            {
                scene.nextStep()
            }
        }
    }

    override public func animateOneFrame() {
        needsDisplay = true
    }
    
    /*
