Beispiel #1
0
int
gs_rmoveto(gs_state *pgs, floatp x, floatp y)
{   int code;
    gs_fixed_point dpt;
    if ( (code = gs_distance_transform2fixed(&pgs->ctm, x, y, &dpt)) >= 0 )
        code = gx_path_add_relative_point(pgs->path, dpt.x, dpt.y);
    return code;
}
Beispiel #2
0
int
gs_rlineto(gs_state *pgs, floatp x, floatp y)
{   gs_fixed_point cpt, dpt;
    int code = gx_path_current_point(pgs->path, &cpt);
    if ( code < 0 ) return code;
    if ( (code = gs_distance_transform2fixed(&pgs->ctm, x, y, &dpt)) >= 0 )
        code = gx_path_add_line(pgs->path, cpt.x + dpt.x, cpt.y + dpt.y);
    return code;
}
Beispiel #3
0
static inline int 
gs_distance_transform_compat(floatp x, floatp y, const gs_matrix_fixed *m, gs_point *pt)
{
#if !PRECISE_CURRENTPOINT
    gs_fixed_point p;
    int code = gs_distance_transform2fixed(m, x, y, &p);

    if (code < 0)
	return code;
    pt->x = fixed2float(p.x);
    pt->y = fixed2float(p.y);
    return 0;
#else
    return gs_distance_transform(x, y, (const gs_matrix *)m, pt);
#endif
}