Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void sp_canvas_item_raise ( SPCanvasItem item,
int  positions 

Raises the item in its parent's stack by the specified number of positions.

item A canvas item.
positions Number of steps to raise the item.
If the number of positions is greater than the distance to the top of the stack, then the item is put at the top.

Definition at line 376 of file sp-canvas.cpp.

References SPCanvasItem::canvas, SPCanvasGroup::items, SPCanvasGroup::last, SPCanvas::need_repick, SPCanvasItem::parent, put_item_after(), and redraw_if_visible().

Referenced by _namedview_modified().

    g_return_if_fail (item != NULL);
    g_return_if_fail (SP_IS_CANVAS_ITEM (item));
    g_return_if_fail (positions >= 0);

    if (!item->parent || positions == 0)

    SPCanvasGroup *parent = SP_CANVAS_GROUP (item->parent);
    GList *link = g_list_find (parent->items, item);
    g_assert (link != NULL);

    GList *before;
    for (before = link; positions && before; positions--)
        before = before->next;

    if (!before)
        before = parent->last;

    put_item_after (link, before);

    redraw_if_visible (item);
    item->canvas->need_repick = TRUE;

Generated by  Doxygen 1.6.0   Back to index