OSDN Git Service
(root)
/
kcd
/
KCD.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9c98f0c
)
10.13以降は CGGlyph を使用するようにした
author
masakih
<masakih@users.sourceforge.jp>
Mon, 13 Aug 2018 15:05:59 +0000
(
00:05
+0900)
committer
masakih
<masakih@users.sourceforge.jp>
Mon, 13 Aug 2018 15:05:59 +0000
(
00:05
+0900)
KCD/StrokeTextFieldCell.swift
patch
|
blob
|
history
diff --git
a/KCD/StrokeTextFieldCell.swift
b/KCD/StrokeTextFieldCell.swift
index
2870fd1
..
7ea4da5
100644
(file)
--- a/
KCD/StrokeTextFieldCell.swift
+++ b/
KCD/StrokeTextFieldCell.swift
@@
-69,13
+69,16
@@
final class StrokeTextFieldCell: NSTextFieldCell {
point.y -= controlView.frame.height
}
point.y -= controlView.frame.height
}
- let nsGlyph = UnsafeMutablePointer<NSGlyph>.allocate(capacity: range.length)
-
- (0..<range.length).forEach { nsGlyph[$0] = NSGlyph(glyph[$0]) }
-
let path = NSBezierPath()
path.move(to: point)
let path = NSBezierPath()
path.move(to: point)
- path.appendGlyphs(nsGlyph, count: glyphLength, in: font)
+ if #available(macOS 13, *) {
+ path.append(withCGGlyphs: glyph, count: glyphLength, in: font)
+ } else {
+ let nsGlyph = UnsafeMutablePointer<NSGlyph>.allocate(capacity: range.length)
+
+ (0..<range.length).forEach { nsGlyph[$0] = NSGlyph(glyph[$0]) }
+ path.appendGlyphs(nsGlyph, count: glyphLength, in: font)
+ }
path.lineWidth = StrokeTextFieldCell.boarderWidth
path.lineJoinStyle = .roundLineJoinStyle
path.lineWidth = StrokeTextFieldCell.boarderWidth
path.lineJoinStyle = .roundLineJoinStyle