OSDN Git Service

改修工廠メニューの使用アイテム欄の幅を大きくした
[kcd/KCD.git] / KCD / StrengthenListItemView.swift
index ea449eb..ab9feed 100644 (file)
@@ -8,25 +8,30 @@
 
 import Cocoa
 
-class StrengthenListItemView: NSBox {
+final class StrengthenListItemView: NSBox {
+    
     override func draw(_ dirtyRect: NSRect) {
+        
         super.draw(dirtyRect)
         
-        let bounds = self.bounds
         let width = bounds.width
         let height = bounds.height
+        
         borderColor.set()
-        NSBezierPath.setDefaultLineWidth(borderWidth)
+        NSBezierPath.defaultLineWidth = borderWidth
         NSBezierPath.stroke(bounds)
-        multiline(lines:
-            [
-                (NSPoint(x: 29.5, y: 0), NSPoint(x: 29.5, y: height)),
-                (NSPoint(x: 67.5, y: 0), NSPoint(x: 67.5, y: height)),
-                (NSPoint(x: 209.5, y: 0), NSPoint(x: 209.5, y: height)),
-                (NSPoint(x: 0, y: 17.5), NSPoint(x: width, y: 17.5)),
-                (NSPoint(x: 0, y: 34.5), NSPoint(x: width, y: 34.5))
-            ]
-            )
+        
+        Polygon()
+            .move(to: NSPoint(x: 29.5, y: 0))
+            .line(to: NSPoint(x: 29.5, y: height))
+            .move(to: NSPoint(x: 67.5, y: 0))
+            .line(to: NSPoint(x: 67.5, y: height))
+            .move(to: NSPoint(x: 227.5, y: 0))
+            .line(to: NSPoint(x: 227.5, y: height))
+            .move(to: NSPoint(x: 0, y: 17.5))
+            .line(to: NSPoint(x: width, y: 17.5))
+            .move(to: NSPoint(x: 0, y: 34.5))
+            .line(to: NSPoint(x: width, y: 34.5))
             .stroke()
     }
 }