OSDN Git Service

カラー名を短縮表記にした
[kcd/KCD.git] / KCD / SlotItemFrameView.swift
1 //
2 //  SlotItemFrameView.swift
3 //  KCD
4 //
5 //  Created by Hori,Masaki on 2017/01/02.
6 //  Copyright © 2017年 Hori,Masaki. All rights reserved.
7 //
8
9 import Cocoa
10
11 final class SlotItemFrameView: NSBox {
12     
13     override func draw(_ dirtyRect: NSRect) {
14         
15         super.draw(dirtyRect)
16         
17         let bounds = self.bounds
18         let width = bounds.width
19         let height = bounds.height
20         NSColor.gridColor.set()
21         NSBezierPath.defaultLineWidth = 1.0
22         
23         Polygon()
24             .move(to: NSPoint(x: 40.5, y: 0))
25             .line(to: NSPoint(x: 40.5, y: height))
26             .move(to: NSPoint(x: 0, y: 17.5))
27             .line(to: NSPoint(x: width, y: 17.5))
28             .move(to: NSPoint(x: 0, y: 34.5))
29             .line(to: NSPoint(x: width, y: 34.5))
30             .move(to: NSPoint(x: 0, y: 51.5))
31             .line(to: NSPoint(x: width, y: 51.5))
32             .move(to: NSPoint(x: 0, y: 68.5))
33             .line(to: NSPoint(x: width, y: 68.5))
34             .stroke()
35     }
36 }