|
@@ -78,7 +78,7 @@ class KMNoteTypeImageView: NSImageView {
|
|
|
if appearanceName == .darkAqua {
|
|
|
strikePath = "KMImageNameAnnotationStrikeout"
|
|
|
highlight = "KMImageNameStikeoutDrakIcon"
|
|
|
- underline = "KMImageNameAnnotationUnderline"
|
|
|
+ underline = "KMImageNameUnderLineDrakIcon"
|
|
|
inkImagePath = "KMImageNameAnnotationFreehandDrak"
|
|
|
inkIcon = "KMImageNameInkDrakIcon"
|
|
|
}
|
|
@@ -142,7 +142,7 @@ class KMNoteTypeImageView: NSImageView {
|
|
|
image?.unlockFocus()
|
|
|
}
|
|
|
} else if type == SKNUnderlineString {
|
|
|
- if let baseImage = NSImage(named: highlight) {
|
|
|
+ if let baseImage = NSImage(named: underline) {
|
|
|
var size = NSMakeSize(20, 20)
|
|
|
image = NSImage(size: size)
|
|
|
image?.lockFocus()
|
|
@@ -261,7 +261,7 @@ class KMNoteTypeImageView: NSImageView {
|
|
|
} else if type == SKMeasureRectangleString {
|
|
|
image = NSImage(named: "KMImageNameListMeasureSquare")?.copy() as? NSImage
|
|
|
} else if type == "Squiggly" {
|
|
|
- if let baseImage = NSImage(named: highlight)?.copy() as? NSImage {
|
|
|
+ if let baseImage = NSImage(named: underline)?.copy() as? NSImage {
|
|
|
// baseImage.size.offset(x: 1.5, y: 1.5)
|
|
|
var size = NSMakeSize(20, 20)
|
|
|
image = NSImage(size: size)
|
|
@@ -269,13 +269,33 @@ class KMNoteTypeImageView: NSImageView {
|
|
|
let ref3 = NSGraphicsContext.current?.cgContext
|
|
|
KMContextSaveGState(ref3)
|
|
|
KMContextBeginPath(ref3)
|
|
|
- KMContextMoveToPoint(ref3, 2, 3)
|
|
|
- KMContextAddCurveToPoint(ref3, image!.size.width/2, -4, 2 * image!.size.width/4, 2 * image!.size.width/4, image!.size.width, 4)
|
|
|
- KMContextSetLineWidth(ref3, 1);
|
|
|
+
|
|
|
+ let length = 24.0
|
|
|
+ let stepLength = 6.0
|
|
|
+ var count = Int(round(length / CGFloat(stepLength)))
|
|
|
+
|
|
|
+ if count == 0 {
|
|
|
+ count = 1
|
|
|
+ }
|
|
|
+ KMContextSetLineWidth(ref3, 2);
|
|
|
if let newColor = color.usingColorSpaceName(.calibratedRGB) {
|
|
|
let newInkColor = NSColor(red: newColor.redComponent, green: newColor.greenComponent, blue: newColor.blueComponent, alpha: 1)
|
|
|
newInkColor.set()
|
|
|
}
|
|
|
+ var initX = 0.0
|
|
|
+ for i in 0..<count {
|
|
|
+ let s = CGPoint(x: initX, y: 2)
|
|
|
+ let e = CGPoint(x: initX + stepLength, y: 2)
|
|
|
+ let cp1 = CGPoint(x: initX + CGFloat(stepLength) / 2, y: 2 + 4)
|
|
|
+ let cp2 = CGPoint(x: initX + CGFloat(stepLength) - CGFloat(stepLength) / 2, y: 0)
|
|
|
+
|
|
|
+ ref3?.move(to: s)
|
|
|
+ ref3?.addCurve(to: e, control1: cp1, control2: cp2)
|
|
|
+ ref3?.strokePath()
|
|
|
+
|
|
|
+ initX += CGFloat(stepLength)
|
|
|
+ }
|
|
|
+
|
|
|
KMContextStrokePath(ref3);
|
|
|
KMContextRestoreGState(ref3);
|
|
|
baseImage.draw(in: CGRect(x: 0, y: 0, width: image!.size.width, height: image!.size.height))
|