Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_node_selected_add_node ( Inkscape::NodePath::Path nodepath  ) 

Call sp_nodepath_line_add_node() for all selected segments.

Todo:
fixme: adjust ?

Definition at line 1666 of file nodepath.cpp.

References Inkscape::NodePath::Node::p, Inkscape::NodePath::Node::selected, Inkscape::NodePath::Path::selected, sp_nodepath_line_add_node(), sp_nodepath_node_select(), sp_nodepath_update_handles(), sp_nodepath_update_repr(), and sp_nodepath_update_statusbar().

{
    if (!nodepath) {
        return;
    }

    GList *nl = NULL;

    int n_added = 0;

    for (GList *l = nodepath->selected; l != NULL; l = l->next) {
       Inkscape::NodePath::Node *t = (Inkscape::NodePath::Node *) l->data;
        g_assert(t->selected);
        if (t->p.other && t->p.other->selected) {
            nl = g_list_prepend(nl, t);
        }
    }

    while (nl) {
       Inkscape::NodePath::Node *t = (Inkscape::NodePath::Node *) nl->data;
       Inkscape::NodePath::Node *n = sp_nodepath_line_add_node(t, 0.5);
       sp_nodepath_node_select(n, TRUE, FALSE);
       n_added ++;
       nl = g_list_remove(nl, t);
    }

    /** \todo fixme: adjust ? */
    sp_nodepath_update_handles(nodepath);

    if (n_added > 1) {
        sp_nodepath_update_repr(nodepath, _("Add nodes"));
    } else if (n_added > 0) {
        sp_nodepath_update_repr(nodepath, _("Add node"));
    }

    sp_nodepath_update_statusbar(nodepath);
}


Generated by  Doxygen 1.6.0   Back to index