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

void SPGradientImpl::childAdded ( SPObject object,
Inkscape::XML::Node child,
Inkscape::XML::Node ref 
) [static, private]

Callback for child_added event.

Todo:
Fixme: should we schedule "modified" here?

Definition at line 593 of file sp-gradient.cpp.

References Inkscape::XML::Node::attribute(), SPGradient::has_stops, SPGradient::invalidateVector(), sp_object_get_child_by_repr(), and sp_object_setAttribute().

Referenced by classInit().

{
    SPGradient *gr = SP_GRADIENT(object);

    gr->invalidateVector();

    if (((SPObjectClass *) gradient_parent_class)->child_added) {
        (* ((SPObjectClass *) gradient_parent_class)->child_added)(object, child, ref);
    }

    SPObject *ochild = sp_object_get_child_by_repr(object, child);
    if ( ochild && SP_IS_STOP(ochild) ) {
        gr->has_stops = TRUE;
        if ( gr->getStopCount() > 0 ) {
            gchar const * attr = gr->repr->attribute("osb:paint");
            if ( attr && strcmp(attr, "gradient") ) {
                sp_object_setAttribute( gr, "osb:paint", "gradient", 0 );
            }
        }
    }

    /// \todo Fixme: should we schedule "modified" here?
    object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index