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

static void sp_radialgradient_set ( SPObject object,
unsigned  key,
gchar const *  value 
) [static]

Set radial gradient attribute.

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

References SPRadialGradient::cx, SPRadialGradient::cy, SPRadialGradient::fx, SPRadialGradient::fy, and SPRadialGradient::r.

Referenced by sp_radialgradient_class_init().

{
    SPRadialGradient *rg = SP_RADIALGRADIENT(object);

    switch (key) {
        case SP_ATTR_CX:
            if (!sp_svg_length_read(value, &rg->cx)) {
                sp_svg_length_unset(&rg->cx, SP_SVG_UNIT_PERCENT, 0.5, 0.5);
            }
            if (!rg->fx.set) {
                rg->fx.value = rg->cx.value;
                rg->fx.computed = rg->cx.computed;
            }
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
            break;
        case SP_ATTR_CY:
            if (!sp_svg_length_read(value, &rg->cy)) {
                sp_svg_length_unset(&rg->cy, SP_SVG_UNIT_PERCENT, 0.5, 0.5);
            }
            if (!rg->fy.set) {
                rg->fy.value = rg->cy.value;
                rg->fy.computed = rg->cy.computed;
            }
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
            break;
        case SP_ATTR_R:
            if (!sp_svg_length_read(value, &rg->r)) {
                sp_svg_length_unset(&rg->r, SP_SVG_UNIT_PERCENT, 0.5, 0.5);
            }
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
            break;
        case SP_ATTR_FX:
            if (!sp_svg_length_read(value, &rg->fx)) {
                sp_svg_length_unset(&rg->fx, rg->cx.unit, rg->cx.value, rg->cx.computed);
            }
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
            break;
        case SP_ATTR_FY:
            if (!sp_svg_length_read(value, &rg->fy)) {
                sp_svg_length_unset(&rg->fy, rg->cy.unit, rg->cy.value, rg->cy.computed);
            }
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
            break;
        default:
            if (((SPObjectClass *) rg_parent_class)->set)
                ((SPObjectClass *) rg_parent_class)->set(object, key, value);
            break;
    }
}


Generated by  Doxygen 1.6.0   Back to index