[dia] DiaRenderer: remove unused _rounded_rect_with_bezier() again



commit 2520c3d279c8b919a392b6c07fa06305d3862e5f
Author: Hans Breuer <hans breuer org>
Date:   Fri Jun 6 12:56:25 2014 +0200

    DiaRenderer: remove unused _rounded_rect_with_bezier() again
    
    Now that main renderers are able to handle draw_rounded_rect() with the
    help of base class implementation (draw_arc, draw_line) emulation this
    copy is not necessary anymore (and unused since). Using it involved some
    magic regarding the existence of draw_beziergon with the derived renderer
    which did not look feel right either.

 lib/diarenderer.c |   38 --------------------------------------
 1 files changed, 0 insertions(+), 38 deletions(-)
---
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index d63e491..e2e50d3 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -851,44 +851,6 @@ draw_polygon (DiaRenderer *renderer,
 }
 
 static void 
-_rounded_rect_with_bezier (DiaRenderer *renderer, 
-                          Point *ul_corner, Point *lr_corner,
-                          Color *fill, Color *stroke, real radius) 
-{
-  /* Conversion algorithm copied from objects/standard/box
-   * If you find bugs here they might be there as well;)
-   */
-  BezPoint *points;
-  const real w = lr_corner->x - ul_corner->x;
-  const real h = lr_corner->y - ul_corner->y;
-  const real x = ul_corner->x;
-  const real y = ul_corner->y;
-  real r = radius;
-  int num_points = 9;
-  points = g_alloca (sizeof(BezPoint) * num_points);
-
-  /* avoid r>w/w and r>h/2 */
-  r = (w > h ) ? (r > h/2 ? h/2 : r) : (r > w/2 ? w/2 : r);
-
-  points[0].type = BEZ_MOVE_TO;  points[0].p1.x = x + r; points[0].p1.y = y; /* top-left */
-  points[1].type = BEZ_LINE_TO;  points[1].p1.x = x + w - r; points[1].p1.y = y; /* top-right */
-  points[2].type = BEZ_CURVE_TO; points[2].p1.x = x + w - r; points[2].p1.y = y; /* around */
-  points[2].p2.x = x + w; points[2].p2.y = y; points[2].p3.x = x + w; points[2].p3.y = y + r;
-  points[3].type = BEZ_LINE_TO; points[3].p1.x =  x + w; points[3].p1.y = y + h - r; /* bottom-right */
-  points[4].type = BEZ_CURVE_TO; points[4].p1.x = x + w; points[4].p1.y = y + h - r; /* around */
-  points[4].p2.x = x + w; points[4].p2.y = y + h; points[4].p3.x = x + w - r; points[4].p3.y = y + h;
-  points[5].type = BEZ_LINE_TO;  points[5].p1.x = x + r; points[5].p1.y = y + h; /* bottom-left */
-  points[6].type = BEZ_CURVE_TO; points[6].p1.x = x + r; points[6].p1.y = y + h; /* around */
-  points[6].p2.x = x; points[6].p2.y = y + h; points[6].p3.x = x; points[6].p3.y = y + h - r;
-  points[7].type = BEZ_LINE_TO;  points[7].p1.x = x; points[7].p1.y = y + r; /* top-left */
-  points[8].type = BEZ_CURVE_TO; points[8].p1.x = x; points[8].p1.y = y + r; /* around */
-  points[8].p2.x = x; points[8].p2.y = y; points[8].p3.x = x + r; points[8].p3.y = y;
-  /* end of copy */
-
-  DIA_RENDERER_GET_CLASS(renderer)->draw_beziergon (renderer, points, num_points, fill, stroke);
-}
-
-static void 
 draw_rounded_rect (DiaRenderer *renderer, 
                    Point *ul_corner, Point *lr_corner,
                    Color *fill, Color *stroke, real radius) 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]