obj_state_t *obj = job->obj;
angle = obj->gradient_angle * M_PI / 180; //angle of gradient line
- G[0].x = G[0].y = G[1].x = G[1].y;
- get_gradient_points(A, G, n, 0, 1);
+ /* G[0].x = G[0].y = G[1].x = G[1].y; */
+ /* get_gradient_points(A, G, n, 0, 1); */
if (angle == 0.) {
ifx = ify = 50;
} else {
cairo_pattern_t* pat;
float angle = obj->gradient_angle * M_PI / 180;
float r1,r2;
- pointf G[2],c1,c2;
+ pointf G[2],c1;
if (filled == GRADIENT) {
get_gradient_points(A, G, n, angle, 0);
else {
get_gradient_points(A, G, n, 0, 1);
//r1 is inner radius, r2 is outer radius
- r1 = G[1].x;
+ r1 = G[1].x; /* Set a r2/4 in get_gradient_points */
r2 = G[1].y;
if (angle == 0) {
c1.x = G[0].x;
c1.y = G[0].y;
}
else {
- c1.x = G[0].x + (r2/4) * cos(angle);
- c1.y = G[0].y - (r2/4) * sin(angle);
+ c1.x = G[0].x + r1 * cos(angle);
+ c1.y = G[0].y - r1 * sin(angle);
}
- c2.x = G[0].x;
- c2.y = G[0].y;
- r1 = r2/4;
- //r1 is inner radius, r2 is outter radius
- pat = cairo_pattern_create_radial(c1.x,c1.y,r1,c2.x,c2.y,r2);
+ pat = cairo_pattern_create_radial(c1.x,c1.y,r1,G[0].x,G[0].y,r2);
}
if (obj->gradient_frac > 0) {
cairogen_add_color_stop_rgba(pat,obj->gradient_frac - 0.001,&(obj->fillcolor));