Logo Search packages:      
Sourcecode: inkscape version File versions

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

Duplicate the selected node(s).

Definition at line 1857 of file nodepath.cpp.

References Inkscape::NodePath::Path::selected, sp_nodepath_deselect(), sp_nodepath_node_duplicate(), sp_nodepath_node_select(), sp_nodepath_update_handles(), and sp_nodepath_update_repr().

{
    if (!nodepath) {
        return;
    }

    GList *temp = NULL;
    for (GList *l = nodepath->selected; l != NULL; l = l->next) {
       Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) l->data;
       Inkscape::NodePath::Node *nn = sp_nodepath_node_duplicate(n);
        if (nn == NULL) continue; // could not duplicate
        temp = g_list_prepend(temp, nn);
    }

    if (temp) {
        sp_nodepath_deselect(nodepath);
    }
    for (GList *l = temp; l != NULL; l = l->next) {
        sp_nodepath_node_select((Inkscape::NodePath::Node *) l->data, TRUE, TRUE);
    }

    sp_nodepath_update_handles(nodepath);

    sp_nodepath_update_repr(nodepath, _("Duplicate node"));
}


Generated by  Doxygen 1.6.0   Back to index