summaryrefslogtreecommitdiffstats
path: root/src/display/curve.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-06-29 13:29:23 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-06-29 13:29:23 +0000
commit632d5341888ab5a814408aee5a6640e84adb05f4 (patch)
treec8fa943fa741fd4780ec602f685f918f10c067a7 /src/display/curve.cpp
parentreplace some spcurve->last_bpath calls with spcurve->is_empty (diff)
downloadinkscape-632d5341888ab5a814408aee5a6640e84adb05f4.tar.gz
inkscape-632d5341888ab5a814408aee5a6640e84adb05f4.zip
add SPCurve::first_segment and last_segment
(bzr r6089)
Diffstat (limited to 'src/display/curve.cpp')
-rw-r--r--src/display/curve.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 1261cf9b0..065365973 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -895,6 +895,23 @@ SPCurve::last_bpath() const
}
/**
+ * Return last pathsegment (possibly the closing path segment) in PathVector or NULL.
+ * equal in functionality to SPCurve::last_bpath()
+ */
+Geom::Curve const *
+SPCurve::last_segment() const
+{
+ if (is_empty()) {
+ return NULL;
+ }
+ if (_pathv.back().empty()) {
+ return NULL;
+ }
+
+ return &_pathv.back().back_default();
+}
+
+/**
* Return last path in PathVector or NULL.
*/
Geom::Path const *
@@ -925,6 +942,23 @@ SPCurve::first_bpath() const
}
/**
+ * Return first pathsegment in PathVector or NULL.
+ * equal in functionality to SPCurve::first_bpath()
+ */
+Geom::Curve const *
+SPCurve::first_segment() const
+{
+ if (is_empty()) {
+ return NULL;
+ }
+ if (_pathv.front().empty()) {
+ return NULL;
+ }
+
+ return &_pathv.front().front();
+}
+
+/**
* Return first path in PathVector or NULL.
*/
Geom::Path const *
@@ -1020,8 +1054,8 @@ SPCurve::last_point() const
return NR::Point(0, 0);
debug_check("SPCurve::last_point", bpath->c(3) == _pathv.back().finalPoint() );
- return bpath->c(3);
- // return from_2geom( _pathv.back().finalPoint() );
+ //return bpath->c(3);
+ return from_2geom( _pathv.back().finalPoint() );
}
inline static bool