From 89a8b4c50582aa7567eca66ae3f7a38d380e7f19 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Thu, 4 Sep 2008 18:56:22 +0000 Subject: [PATCH] convert moveto, lineto and curveto native to Point, instead of going to gdouble to go back to Point again.... --- src/display/curve.cpp | 16 ++++++---------- 1 file 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( 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::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( 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::Point(x0,y0), Geom::Point(x1,y1), Geom::Point(x2,y2) ); + curveto( Geom::Point(x0,y0), Geom::Point(x1,y1), Geom::Point(x2,y2) ); } /** -- 2.30.2