From 00ee8f8987594681766a1583aeab19c34b47a371 Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Thu, 8 Aug 2013 15:23:06 -0400 Subject: [PATCH] Cleanup redundant or vacuous code. --- plugin/core/gvrender_core_svg.c | 4 ++-- plugin/pango/gvrender_pango.c | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c index 1dfa73770..39521a5e6 100644 --- a/plugin/core/gvrender_core_svg.c +++ b/plugin/core/gvrender_core_svg.c @@ -490,8 +490,8 @@ static int svg_rgradstyle(GVJ_t * job, pointf * A, int n) 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 { diff --git a/plugin/pango/gvrender_pango.c b/plugin/pango/gvrender_pango.c index e40c364f6..174d1ef7a 100644 --- a/plugin/pango/gvrender_pango.c +++ b/plugin/pango/gvrender_pango.c @@ -268,7 +268,7 @@ static void cairo_gradient_fill (cairo_t* cr, obj_state_t* obj, int filled, poin 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); @@ -277,21 +277,17 @@ static void cairo_gradient_fill (cairo_t* cr, obj_state_t* obj, int filled, poin 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)); -- 2.40.0