summaryrefslogtreecommitdiffstats
path: root/src/sp-path.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-06-06 01:43:35 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-06-06 01:43:35 +0000
commit8a38c52bce619b07117cdd87a183eb05fb51e28e (patch)
tree39b9f2af1ce9df43884a3b33ca2445097fe8f5a5 /src/sp-path.cpp
parentoops. sys/wait.h not on win32 (diff)
downloadinkscape-8a38c52bce619b07117cdd87a183eb05fb51e28e.tar.gz
inkscape-8a38c52bce619b07117cdd87a183eb05fb51e28e.zip
merge gsoc2008_johan_path2geom into trunk
(bzr r5823)
Diffstat (limited to 'src/sp-path.cpp')
-rw-r--r--src/sp-path.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 511e1efc5..81d05ebef 100644
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
@@ -122,14 +122,9 @@ gint
sp_nodes_in_path(SPPath *path)
{
SPCurve *curve = SP_SHAPE(path)->curve;
- if (!curve) return 0;
- gint r = curve->_end;
- gint i = curve->_length - 1;
- if (i > r) i = r; // sometimes after switching from node editor length is wrong, e.g. f6 - draw - f2 - tab - f1, this fixes it
- for (; i >= 0; i --)
- if (SP_CURVE_BPATH(curve)[i].code == NR_MOVETO)
- r --;
- return r;
+ if (!curve)
+ return 0;
+ return curve->nodes_in_path();
}
static gchar *
@@ -313,7 +308,7 @@ sp_path_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
}
if ( shape->curve != NULL ) {
- NArtBpath *abp = shape->curve->first_bpath();
+ NArtBpath const * abp = shape->curve->get_bpath();
if (abp) {
gchar *str = sp_svg_write_path(abp);
repr->setAttribute("d", str);
@@ -327,7 +322,7 @@ sp_path_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
SPPath *path = (SPPath *) object;
if ( path->original_curve != NULL ) {
- NArtBpath *abp = path->original_curve->first_bpath();
+ NArtBpath const * abp = path->original_curve->get_bpath();
if (abp) {
gchar *str = sp_svg_write_path(abp);
repr->setAttribute("inkscape:original-d", str);
@@ -419,7 +414,7 @@ sp_path_update_patheffect(SPLPEItem *lpeitem, bool write)
// could also do SP_OBJECT(shape)->updateRepr(); but only the d attribute needs updating.
Inkscape::XML::Node *repr = SP_OBJECT_REPR(shape);
if ( shape->curve != NULL ) {
- NArtBpath *abp = shape->curve->first_bpath();
+ NArtBpath const *abp = shape->curve->get_bpath();
if (abp) {
gchar *str = sp_svg_write_path(abp);
repr->setAttribute("d", str);