I understand there is CGContextClearRect though that makes you clear everything inside the drawRect class.
How do i select one CGContextRef and clear that instead?
for my case my code goes:
//Put clearing syntax here
if(dp.gPoints == nil || dp.gPoints->size() < 1)
return;
CGContextBeginPath(g);
vector<CGPoint>::iterator k = dp.gPoints->begin();
CGContextMoveToPoint(g, (*k).x, (*k).y);
++k;
while(k != dp.gPoints->end()){
CGContextAddLineToPoint(g, (*k).x, (*k).y);
++k;
}
vector<CGPoint>::reverse_iterator L = dp.dPoints->rbegin();
while(L != dp.doodlePoints->rend()){
CGContextAddLineToPoint(g, (*L).x, (*L).y);
++L;
}
//CGContextAddLineToPoint(g, (*k).x, (*k).y);
CGContextSetFillColor(g, CGColorGetComponents([[UIColor greenColor] CGColor]));
CGContextEOFillPath(g);
Replace these two lines:
with these lines:
assuming
rectwas the argument passed to yourdrawRect:method.