|
@@ -2402,7 +2402,9 @@ static void YYTextDrawBorderRects(CGContextRef context, CGSize size, YYTextBorde
|
|
//-------------------------- single line ------------------------------//
|
|
//-------------------------- single line ------------------------------//
|
|
CGContextSaveGState(context);
|
|
CGContextSaveGState(context);
|
|
for (UIBezierPath *path in paths) {
|
|
for (UIBezierPath *path in paths) {
|
|
- CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));
|
|
|
|
|
|
+ CGRect bounds = CGRectUnion(path.bounds, (CGRect){CGPointZero, size});
|
|
|
|
+ bounds = CGRectInset(bounds, -2 * border.strokeWidth, -2 * border.strokeWidth);
|
|
|
|
+ CGContextAddRect(context, bounds);
|
|
CGContextAddPath(context, path.CGPath);
|
|
CGContextAddPath(context, path.CGPath);
|
|
CGContextEOClip(context);
|
|
CGContextEOClip(context);
|
|
}
|
|
}
|
|
@@ -2443,7 +2445,10 @@ static void YYTextDrawBorderRects(CGContextRef context, CGSize size, YYTextBorde
|
|
rect = CGRectInset(rect, inset, inset);
|
|
rect = CGRectInset(rect, inset, inset);
|
|
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:border.cornerRadius + 2 * border.strokeWidth];
|
|
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:border.cornerRadius + 2 * border.strokeWidth];
|
|
[path closePath];
|
|
[path closePath];
|
|
- CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));
|
|
|
|
|
|
+
|
|
|
|
+ CGRect bounds = CGRectUnion(path.bounds, (CGRect){CGPointZero, size});
|
|
|
|
+ bounds = CGRectInset(bounds, -2 * border.strokeWidth, -2 * border.strokeWidth);
|
|
|
|
+ CGContextAddRect(context, bounds);
|
|
CGContextAddPath(context, path.CGPath);
|
|
CGContextAddPath(context, path.CGPath);
|
|
CGContextEOClip(context);
|
|
CGContextEOClip(context);
|
|
}
|
|
}
|