From: johanengelen Date: Mon, 30 Jun 2008 20:02:10 +0000 (+0000) Subject: simplify SPCurve::penultimate_point and return 2geom type X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2b5773d0d79658121973205a23499487f2a2a5fc;p=inkscape.git simplify SPCurve::penultimate_point and return 2geom type --- diff --git a/src/display/curve.cpp b/src/display/curve.cpp index 6c4baaa96..5dca3c00f 100644 --- a/src/display/curve.cpp +++ b/src/display/curve.cpp @@ -1030,17 +1030,13 @@ SPCurve::penultimate_point() const NArtBpath *const bpath = _bpath + _end - 2; g_return_val_if_fail(bpath != NULL, NR::Point(0, 0)); - - Geom::Point p(NR_HUGE, NR_HUGE); - Geom::Curve const& back = _pathv.back().back(); - if (_pathv.back().closed()) { - p = back.finalPoint(); - } else { - p = back.initialPoint(); - } - debug_check("SPCurve::penultimate_point", bpath->c(3) == p ); - return bpath->c(3); + + Geom::Curve const& back = _pathv.back().back_default(); + Geom::Point p = back.initialPoint(); + + debug_check("SPCurve::penultimate_point", bpath->c(3) == from_2geom(p) ); + return from_2geom(p); } /**