summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-09-04 18:56:22 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-09-04 18:56:22 +0000
commitbb22edfc7035b1df3e0d59a345a78d76db8276ce (patch)
tree62ed946549d9a585623c72fc004f6fdd2e8174df /src
parentAdd a zoom correction option to preferences (used when zooming to 1:1 etc. to... (diff)
downloadinkscape-bb22edfc7035b1df3e0d59a345a78d76db8276ce.tar.gz
inkscape-bb22edfc7035b1df3e0d59a345a78d76db8276ce.zip
convert moveto, lineto and curveto native to Point, instead of going to gdouble to go back to Point again....
(bzr r6759)
Diffstat (limited to 'src')
-rw-r--r--src/display/curve.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 8b1d977f5..c5bb0d231 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -214,7 +214,8 @@ SPCurve::moveto(Geom::Point const &p)
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.
@@ -222,8 +223,7 @@ SPCurve::lineto(Geom::Point const &p)
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));
}
/**
@@ -232,11 +232,8 @@ SPCurve::lineto(gdouble x, gdouble 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) );
}
/**