Hello,
I have a strange issue.I can't draw a point it's always a line.The code below is for drawing .
-(void)drawInk:(CGContextRef)context
{
if( m_status == sta_ink && m_ink )
{
NSLog(@"g_ink_color = %d",g_ink_color);
int cnt = [m_ink nodesCount];
int cur = 0;
CGContextSetLineWidth(context, g_Ink_Width);
float red = ((g_ink_color>>16)&0xFF)/255.0f;
float green = ((g_ink_color>>8)&0xFF)/255.0f;
float blue = (g_ink_color&0xFF)/255.0f;
float alpha = ((g_ink_color>>24)&0xFF)/255.0f;
CGContextSetRGBStrokeColor(context, red, green, blue, alpha);
CGContextBeginPath( context );
while( cur < cnt )
{
PDF_POINT pt;
PDF_POINT pt2;
int type = [m_ink node: cur: &pt];
switch( type )
{
case 1:
CGContextAddLineToPoint(context, self.contentOffset.x + pt.x/m_scale, self.contentOffset.y + pt.y/m_scale);
cur++;
break;
case 2:
[m_ink node: cur + 1: &pt2];
CGContextAddCurveToPoint(context, self.contentOffset.x + pt.x/m_scale, self.contentOffset.y + pt.y/m_scale,
self.contentOffset.x + pt.x/m_scale, self.contentOffset.y + pt.y/m_scale,
self.contentOffset.x + pt2.x/m_scale, self.contentOffset.y + pt2.y/m_scale );
cur += 2;
break;
default:
CGContextMoveToPoint(context, self.contentOffset.x + pt.x/m_scale, self.contentOffset.y + pt.y/m_scale);
cur++;
break;
}
}
CGContextStrokePath( context );
}
}
Thank you a lot for your help