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

static Inkscape::XML::Node * sp_lineargradient_write ( SPObject object,
Inkscape::XML::Node repr,
guint  flags 
) [static]

Callback: write attributes to associated repr.

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

References sp_repr_set_svg_double(), SPLinearGradient::x1, SPLinearGradient::x2, SPLinearGradient::y1, and SPLinearGradient::y2.

Referenced by sp_lineargradient_class_init().

{
    SPLinearGradient *lg = SP_LINEARGRADIENT(object);

    if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
        Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
        repr = xml_doc->createElement("svg:linearGradient");
    }

    if ((flags & SP_OBJECT_WRITE_ALL) || lg->x1._set)
        sp_repr_set_svg_double(repr, "x1", lg->x1.computed);
    if ((flags & SP_OBJECT_WRITE_ALL) || lg->y1._set)
        sp_repr_set_svg_double(repr, "y1", lg->y1.computed);
    if ((flags & SP_OBJECT_WRITE_ALL) || lg->x2._set)
        sp_repr_set_svg_double(repr, "x2", lg->x2.computed);
    if ((flags & SP_OBJECT_WRITE_ALL) || lg->y2._set)
        sp_repr_set_svg_double(repr, "y2", lg->y2.computed);

    if (((SPObjectClass *) lg_parent_class)->write)
        (* ((SPObjectClass *) lg_parent_class)->write)(object, repr, flags);

    return repr;
}


Generated by  Doxygen 1.6.0   Back to index