summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 877345d)
raw | patch | inline | side by side (parent: 877345d)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 4 Sep 2008 18:56:22 +0000 (18:56 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 4 Sep 2008 18:56:22 +0000 (18:56 +0000) |
src/display/curve.cpp | patch | blob | history |
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 8b1d977f565afb01e4258044c546f3407c85fbcc..c5bb0d2310f7f55039d9e1d4f09aabf24802983b 100644 (file)
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
void
SPCurve::lineto(Geom::Point const &p)
{
- lineto(p[Geom::X], p[Geom::Y]);
+ if (_pathv.empty()) g_message("SPCurve::lineto path is empty!");
+ else _pathv.back().appendNew<Geom::LineSegment>( p );
}
/**
* Adds a line to the current subpath.
void
SPCurve::lineto(gdouble x, gdouble y)
{
- if (_pathv.empty()) g_message("leeg");
- else _pathv.back().appendNew<Geom::LineSegment>( Geom::Point(x,y) );
+ lineto(Geom::Point(x,y));
}
/**
void
SPCurve::curveto(Geom::Point const &p0, Geom::Point const &p1, Geom::Point const &p2)
{
- using Geom::X;
- using Geom::Y;
- curveto( p0[X], p0[Y],
- p1[X], p1[Y],
- p2[X], p2[Y] );
+ if (_pathv.empty()) g_message("SPCurve::lineto path is empty!");
+ else _pathv.back().appendNew<Geom::CubicBezier>( p0, p1, p2 );
}
/**
* Adds a bezier segment to the current subpath.
@@ -244,8 +241,7 @@ SPCurve::curveto(Geom::Point const &p0, Geom::Point const &p1, Geom::Point const
void
SPCurve::curveto(gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble x2, gdouble y2)
{
- if (_pathv.empty()) g_message("leeg");
- else _pathv.back().appendNew<Geom::CubicBezier>( Geom::Point(x0,y0), Geom::Point(x1,y1), Geom::Point(x2,y2) );
+ curveto( Geom::Point(x0,y0), Geom::Point(x1,y1), Geom::Point(x2,y2) );
}
/**