Code

use 2geom bezier fitting (is copy of inkscape's)
authorjohanengelen <johanengelen@users.sourceforge.net>
Wed, 10 Dec 2008 18:57:09 +0000 (18:57 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Wed, 10 Dec 2008 18:57:09 +0000 (18:57 +0000)
src/dyna-draw-context.cpp
src/eraser-context.cpp
src/sp-spiral.cpp
src/tweak-context.cpp

index 5ad5f0f3f54a92450fbfedf4c818093d659a6213..402af6d49797d25fac1643d09b0bc376d3066c13 100644 (file)
@@ -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 <glib/gmem.h>
 #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)) );
 
index 17e69c6aca8dcbecfad38eeca2132a337f4063cb..8854dbcec9e65241b6852b6fa79cf1b5b9bc2d50 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "svg/svg.h"
 #include "display/canvas-bpath.h"
-#include "display/bezier-utils.h"
+#include <2geom/bezier-utils.h>
 
 #include <glib/gmem.h>
 #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)) );
 
index 23233d04e1f8921e0a9d6750b1006a0c5504a62a..377cc13f4264ee67cf070d8032134978a066a47a 100644 (file)
@@ -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 <glibmm/i18n.h>
 #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);
index 3cc26393b958f73cf55bc62408b13f0dc8ac753c..fd8f098fe9664bd69a85958905baed57bad45a07 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "svg/svg.h"
 #include "display/canvas-bpath.h"
-#include "display/bezier-utils.h"
 
 #include <glib/gmem.h>
 #include "macros.h"