OSDN Git Service

バージョンを1.9b33に更新
[kcd/KCD.git] / KCD / BorderTextField.swift
1 //
2 //  BorderTextField.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 BorderTextField: NSTextField {
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.controlShadowColor.set()
21         NSBezierPath.defaultLineWidth = 1.0
22         
23         multiline(lines:
24             [
25                 (NSPoint(x: 3, y: height), NSPoint(x: bounds.maxX, y: height)),
26                 (NSPoint(x: width, y: 0), NSPoint(x: width, y: height))
27             ])
28             .stroke()
29     }
30 }