亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

ios - iphone When using UIGraphicsGetCurrentContext in drawRect to draw a rectangle, is there an excess of 1 pixel outside the border?
我想大聲告訴你
我想大聲告訴你 2017-05-16 13:18:51
0
1
1118

code show as below

-(void) drawRect:(CGRect)rect{
//CGContextRef context = UIGraphicsGetCurrentContext();
//CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, 0.2);
[[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.2]setFill];
CGRect grayRect = self.frame;
UIRectFill(grayRect);

CGRect cropRect = _intersectionRect;
CGRect intersectionRect = CGRectIntersection(cropRect, grayRect);
[[UIColor clearColor]setFill];
UIRectFill(intersectionRect);
}

In the demo of the blank project, everything is ok

But in my own project, there are extra 1px and borders with different transparency. How to solve it?

我想大聲告訴你
我想大聲告訴你

reply all(1)
劉奇

Problem solved, the values ??of both rects should be set to int instead of float.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template