Logo Search packages:      
Sourcecode: inkscape version File versions

void Inkscape::ObjectHierarchy::setBottom ( SPObject object  ) 

Trim or expand hierarchy at bottom such that object becomes bottom entry.

Definition at line 108 of file object-hierarchy.cpp.

References _addBottom(), _trimBelow(), SPObject::isAncestorOf(), sp_object_ref(), and sp_object_unref().

Referenced by _reconstruction_start(), and SPDesktop::setCurrentLayer().

                                                {
    g_return_if_fail(object != NULL);

    if ( bottom() == object ) {
        return;
    }

    if (!top()) {
        _addBottom(object);
    } else if (bottom()->isAncestorOf(object)) {
        _addBottom(bottom(), object);
    } else if ( top() == object ) {
        _trimBelow(top());
    } else if (top()->isAncestorOf(object)) {
        if (object->isAncestorOf(bottom())) {
            _trimBelow(object);
        } else { // object is a sibling or cousin of bottom()
            SPObject *saved_top=top();
            sp_object_ref(saved_top, NULL);
            _clear();
            _addBottom(saved_top);
            _addBottom(saved_top, object);
            sp_object_unref(saved_top, NULL);
        }
    } else {
        _clear();
        _addBottom(object);
    }

    _changed_signal.emit(top(), bottom());
}


Generated by  Doxygen 1.6.0   Back to index