|
@@ -59,7 +59,10 @@ import Foundation
|
|
|
if (isHover) {
|
|
|
let lengths: [CGFloat] = [5.0, 5.0]
|
|
|
context.setLineDash(phase: 0.0, lengths: lengths)
|
|
|
- context.stroke(KMRectInset(NSRectToCGRect(rect), 0,0), width: lineWidth)
|
|
|
+ let clipRect = context.boundingBoxOfClipPath // 获取剪辑边界矩形
|
|
|
+ if(clipRect.width >= rect.width || clipRect.height >= rect.height ) {
|
|
|
+ context.stroke(KMRectInset(NSRectToCGRect(rect), 0,0), width: lineWidth)
|
|
|
+ }
|
|
|
} else {
|
|
|
context.stroke(KMRectInset(NSRectToCGRect(rect), 0,0), width: lineWidth)
|
|
|
}
|