When i drawn a path with the code below:
Code :
    VGPath path;
    VGfloat m[9];
    VGfloat color[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
    VGint pattern[] = { 50, 30, 20, 10 };
 
    VGfloat colorpaint[4] = { 1.0f, 0.0f, 0.0f, 1.0f };
    VGPaint paint;
    VGubyte segments[] = { VG_MOVE_TO_ABS, VG_LINE_TO_ABS};
    VGfloat coords[]   = { 40.0f, 20.0f, 40.0f, 200.0f};
 
    paint = vgCreatePaint();
    vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
    vgSetParameterfv(paint, VG_PAINT_COLOR, 4, colorpaint);
    vgSetPaint(paint, VG_STROKE_PATH);
    vgSetf(VG_STROKE_LINE_WIDTH, 20.0f);
 
    vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
    vgLoadIdentity();
 
    path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);
    vgAppendPathData( path, 2, segments, coords );
 
    [color=#FF0040]vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_SQUARE);[/color]  
    vgDrawPath( path,  VG_STROKE_PATH);

Why there is a gap between the line and the cap?