summaryrefslogtreecommitdiffstats
path: root/src/display/curve.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/display/curve.cpp')
-rw-r--r--src/display/curve.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 4144bb623..df1666d2e 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -1,7 +1,7 @@
#define __CURVE_C__
/** \file
- * Routines for SPCurve and for NArtBpath arrays in general.
+ * Routines for SPCurve and for NArtBpath arrays / Geom::PathVector in general.
*/
/*
@@ -895,6 +895,21 @@ SPCurve::last_bpath() const
}
/**
+ * Return last path in PathVector or NULL.
+ */
+Geom::Path const *
+SPCurve::last_path() const
+{
+ g_return_val_if_fail(this != NULL, NULL);
+
+ if (is_empty()) {
+ return NULL;
+ }
+
+ return &_pathv.back();
+}
+
+/**
* Return first subpath or NULL.
*/
NArtBpath const *
@@ -910,6 +925,21 @@ SPCurve::first_bpath() const
}
/**
+ * Return first path in PathVector or NULL.
+ */
+Geom::Path const *
+SPCurve::first_path() const
+{
+ g_return_val_if_fail(this != NULL, NULL);
+
+ if (is_empty()) {
+ return NULL;
+ }
+
+ return &_pathv.front();
+}
+
+/**
* Return first point of first subpath or (0,0). TODO: shouldn't this be (NR_HUGE, NR_HUGE) to be able to tell it apart from normal (0,0) ?
*/
NR::Point
@@ -1080,9 +1110,9 @@ SPCurve::append(SPCurve const *curve2,
case NR_MOVETO_OPEN:
if (use_lineto && _hascpt) {
lineto(bp->x3, bp->y3);
- use_lineto = FALSE;
+ use_lineto = false;
} else {
- if (closed) closepath();
+ if (closed && _hascpt) closepath();
moveto(bp->x3, bp->y3);
}
closed = false;
@@ -1093,7 +1123,7 @@ SPCurve::append(SPCurve const *curve2,
lineto(bp->x3, bp->y3);
use_lineto = FALSE;
} else {
- if (closed) closepath();
+ if (closed && _hascpt) closepath();
moveto(bp->x3, bp->y3);
}
closed = true;