2017-05-10 3 views
0

저는 Rect를 그리기 위해 Quart2D를 사용하지만 제 생각에는 작동하지 않습니다. 아래drawRect에서 iphone 사용 Quart2D API에 1px 중복 라인이 있습니까?

내 코드 : 데모를 실행 빈 프로젝트에서

-(void) drawRect:(CGRect)rect{ 
[[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); 
} 

는 모든 작동합니다 :

enter image description here

그러나 5 월 프로젝트

, 나는 다른과 1 개 픽셀 라인을 얻을 알파 값 :

enter image description here

디버깅하는 데 몇 시간이 걸립니다. 누가 대답하는지 알려 주시면 고맙겠습니다 :)

답변

0

문제가 해결되었습니다.

두 개의 rect 값은 int이어야하며 float이 아닙니다.

관련 문제