Skip to content

Commit

Permalink
Use border radius when drawing focus rings (facebook#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
appden authored Nov 19, 2020
1 parent 6e78874 commit 881c7d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion React/Views/RCTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,13 @@ - (CGRect)focusRingMaskBounds
- (void)drawFocusRingMask
{
if ([self enableFocusRing]) {
NSRectFill(self.bounds);
CGContextRef context = NSGraphicsContext.currentContext.CGContext;
RCTCornerInsets cornerInsets = RCTGetCornerInsets(self.cornerRadii, NSEdgeInsetsZero);
CGPathRef path = RCTPathCreateWithRoundedRect(self.bounds, cornerInsets, NULL);

CGContextAddPath(context, path);
CGContextFillPath(context);
CGPathRelease(path);
}
}
#endif
Expand Down

0 comments on commit 881c7d2

Please sign in to comment.