Code

simplify code that puts anchors at start and end of paths in draw context.
authorjohanengelen <johanengelen@users.sourceforge.net>
Sun, 8 Jun 2008 18:33:23 +0000 (18:33 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sun, 8 Jun 2008 18:33:23 +0000 (18:33 +0000)
src/draw-context.cpp

index 8858a4560e94334b6cd87217fdff26bfc95b7632..4d60cda050e87ec78a70a6f4aa96077dba6e1839 100644 (file)
@@ -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);
             }
         }