From: johanengelen Date: Sun, 8 Jun 2008 18:33:23 +0000 (+0000) Subject: simplify code that puts anchors at start and end of paths in draw context. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5d67bd380afd0885c8b4656cb3383aea24aedfcb;p=inkscape.git simplify code that puts anchors at start and end of paths in draw context. --- diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 8858a4560..4d60cda05 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -313,14 +313,11 @@ spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection */*sel*/) SPCurve *c; c = (SPCurve*)l->data; g_return_if_fail( c->get_length() > 1 ); - if ( SP_CURVE_BPATH(c)->code == NR_MOVETO_OPEN ) { - NArtBpath const *s, *e; + if ( !c->is_closed() ) { SPDrawAnchor *a; - s = c->first_bpath(); - e = c->last_bpath(); - a = sp_draw_anchor_new(dc, c, TRUE, NR::Point(s->x3, s->y3)); + a = sp_draw_anchor_new(dc, c, TRUE, c->first_point()); dc->white_anchors = g_slist_prepend(dc->white_anchors, a); - a = sp_draw_anchor_new(dc, c, FALSE, NR::Point(e->x3, e->y3)); + a = sp_draw_anchor_new(dc, c, FALSE, c->last_point()); dc->white_anchors = g_slist_prepend(dc->white_anchors, a); } }