OSDN Git Service

関数名を変更
[kcd/KCD.git] / KCD / BorderTextField.swift
index e8b65f7..ee6b754 100644 (file)
@@ -8,20 +8,23 @@
 
 import Cocoa
 
-class BorderTextField: NSTextField {
+final class BorderTextField: NSTextField {
+    
     override func draw(_ dirtyRect: NSRect) {
+        
         super.draw(dirtyRect)
 
         let bounds = self.bounds
-        let width = NSWidth(bounds)
-        let height = NSHeight(bounds)
+        let width = bounds.width
+        let height = bounds.height
         NSColor.controlShadowColor.set()
-        NSBezierPath.setDefaultLineWidth(1.0)
-        multiline {
-            Array<(NSPoint, NSPoint)>()
-                .appended { (NSPoint(x: 3, y: height), NSPoint(x: NSMaxX(bounds), y: height)) }
-                .appended { (NSPoint(x: width, y: 0), NSPoint(x: width, y: height)) }
-            }
-            .map { $0.stroke() }
+        NSBezierPath.defaultLineWidth = 1.0
+        
+        Polygon()
+            .move(to: NSPoint(x: 3, y: height))
+            .line(to: NSPoint(x: bounds.maxX, y: height))
+            .move(to: NSPoint(x: width, y: 0))
+            .line(to: NSPoint(x: width, y: height))
+            .stroke()
     }
 }