OSDN Git Service

staticプロパティをインスタンスプロパティに変更
[kcd/KCD.git] / KCD / FadeoutTextField.swift
index 1d265a4..2a54ccb 100644 (file)
@@ -34,14 +34,16 @@ class FadeoutTextField: NSTextField {
     
     override func draw(_ dirtyRect: NSRect) {
         
-        guard let context = NSGraphicsContext.current()?.cgContext
-            else { fatalError("Con not get current CGContext") }
+        guard let context = NSGraphicsContext.current?.cgContext else {
+            
+            fatalError("Con not get current CGContext")
+        }
         
         context.saveGState()
         maskImage.map { context.clip(to: bounds, mask: $0) }
         
         super.draw(dirtyRect)
-
+        
         context.restoreGState()
     }