Hi. I'm drawing a shaded overlay over a set of cards. The overlay is 50% opaque black. It's built by adding the bounding rect of the UIView to the context path, then by adding three rounded rects, each built using the following code:
// Get the state we need
CGPoint topMiddle;
topMiddle.x = inRect.midX();
topMiddle.y = inRect.maxY();
CGPoint topLeft;
topLeft.x = inRect.minX();
topLeft.y = inRect.maxY();
CGPoint bottomLeft;
bottomLeft.x = inRect.minX();
bottomLeft.y = inRect.minY();
CGPoint bottomRight;
bottomRight.x = inRect.maxX();
bottomRight.y = inRect.minY();
CGPoint topRight;
topRight.x = inRect.maxX();
topRight.y = inRect.maxY();
// Add the rect
::CGContextMoveToPoint( getCGContext(), topMiddle.x, topMiddle.y);
::CGContextAddArcToPoint( getCGContext(), topLeft.x, topLeft.y, bottomLeft.y, bottomLeft.y, inRadius);
::CGContextAddArcToPoint( getCGContext(), bottomLeft.x, bottomLeft.y, bottomRight.x, bottomRight.y, inRadius);
::CGContextAddArcToPoint( getCGContext(), bottomRight.x, bottomRight.y, topRight.x, topRight.y, inRadius);
::CGContextAddArcToPoint( getCGContext(), topRight.x, topRight.y, topMiddle.x, topMiddle.y, inRadius);
::CGContextAddLineToPoint(getCGContext(), topMiddle.x, topMiddle.y);
I then do an EOFill operation with 50% black.
Notice the lower-left corner of each of the punched-out areas (with the green gradient). Depending on how close to the left of the screen, and to the bottom, the effect is more pronounced. The further away, you an actually see the bottom-left corner mutate in the opposite direction.
Any idea what's going on here? I'm successfully using the same code to draw and fill rounded rects all over the place.
Thanks,
Rick