From 1a30ca791d615dad5235a63526a45e6ca06f9634 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Wed, 10 Dec 2008 18:57:09 +0000 Subject: [PATCH] use 2geom bezier fitting (is copy of inkscape's) --- src/dyna-draw-context.cpp | 6 +++--- src/eraser-context.cpp | 6 +++--- src/sp-spiral.cpp | 4 ++-- src/tweak-context.cpp | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 5ad5f0f3f..402af6d49 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -34,7 +34,7 @@ #include "svg/svg.h" #include "display/canvas-bpath.h" -#include "display/bezier-utils.h" +#include <2geom/bezier-utils.h> #include "display/curve.h" #include #include "macros.h" @@ -1127,12 +1127,12 @@ fit_and_split(SPDynaDrawContext *dc, gboolean release) } Geom::Point b1[BEZIER_MAX_LENGTH]; - gint const nb1 = sp_bezier_fit_cubic_r(b1, dc->point1, dc->npoints, + gint const nb1 = Geom::bezier_fit_cubic_r(b1, dc->point1, dc->npoints, tolerance_sq, BEZIER_MAX_BEZIERS); g_assert( nb1 * BEZIER_SIZE <= gint(G_N_ELEMENTS(b1)) ); Geom::Point b2[BEZIER_MAX_LENGTH]; - gint const nb2 = sp_bezier_fit_cubic_r(b2, dc->point2, dc->npoints, + gint const nb2 = Geom::bezier_fit_cubic_r(b2, dc->point2, dc->npoints, tolerance_sq, BEZIER_MAX_BEZIERS); g_assert( nb2 * BEZIER_SIZE <= gint(G_N_ELEMENTS(b2)) ); diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index 17e69c6ac..8854dbcec 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -34,7 +34,7 @@ #include "svg/svg.h" #include "display/canvas-bpath.h" -#include "display/bezier-utils.h" +#include <2geom/bezier-utils.h> #include #include "macros.h" @@ -943,12 +943,12 @@ fit_and_split(SPEraserContext *dc, gboolean release) } Geom::Point b1[BEZIER_MAX_LENGTH]; - gint const nb1 = sp_bezier_fit_cubic_r(b1, dc->point1, dc->npoints, + gint const nb1 = Geom::bezier_fit_cubic_r(b1, dc->point1, dc->npoints, tolerance_sq, BEZIER_MAX_BEZIERS); g_assert( nb1 * BEZIER_SIZE <= gint(G_N_ELEMENTS(b1)) ); Geom::Point b2[BEZIER_MAX_LENGTH]; - gint const nb2 = sp_bezier_fit_cubic_r(b2, dc->point2, dc->npoints, + gint const nb2 = Geom::bezier_fit_cubic_r(b2, dc->point2, dc->npoints, tolerance_sq, BEZIER_MAX_BEZIERS); g_assert( nb2 * BEZIER_SIZE <= gint(G_N_ELEMENTS(b2)) ); diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index 23233d04e..377cc13f4 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -19,7 +19,7 @@ #include "svg/svg.h" #include "attributes.h" -#include "display/bezier-utils.h" +#include <2geom/bezier-utils.h> #include "display/curve.h" #include #include "xml/repr.h" @@ -388,7 +388,7 @@ sp_spiral_fit_and_draw (SPSpiral const *spiral, /** \todo * We should use better algorithm to specify maximum error. */ - depth = sp_bezier_fit_cubic_full (bezier, NULL, darray, SAMPLE_SIZE, + depth = Geom::bezier_fit_cubic_full (bezier, NULL, darray, SAMPLE_SIZE, hat1, hat2, SPIRAL_TOLERANCE*SPIRAL_TOLERANCE, FITTING_MAX_BEZIERS); diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 3cc26393b..fd8f098fe 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -21,7 +21,6 @@ #include "svg/svg.h" #include "display/canvas-bpath.h" -#include "display/bezier-utils.h" #include #include "macros.h" -- 2.30.2