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

static void gradient_ref_changed ( SPObject old_ref,
SPObject ref,
SPGradient gr 
) [static]

Gets called when the gradient is (re)attached to another gradient.

Fixme: what should the flags (second) argument be? */

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

References SPObject::connectModified(), SPGradient::modified_connection, sp_gradient_get_spread(), sp_gradient_get_units(), SPGradient::spread, SPGradient::spread_set, SPGradient::units, and SPGradient::units_set.

Referenced by sp_gradient_init().

    if (old_ref) {
    if ( SP_IS_GRADIENT(ref)
         && ref != gr )
        gr->modified_connection = ref->connectModified(sigc::bind<2>(sigc::ptr_fun(&gradient_ref_modified), gr));

    // Per SVG, all unset attributes must be inherited from linked gradient.
    // So, as we're now (re)linked, we assign linkee's values to this gradient if they are not yet set -
    // but without setting the _set flags.
    // FIXME: do the same for gradientTransform too
    if (!gr->units_set)
        gr->units = sp_gradient_get_units (gr);
    if (!gr->spread_set)
        gr->spread = sp_gradient_get_spread (gr);

    /// \todo Fixme: what should the flags (second) argument be? */
    gradient_ref_modified(ref, 0, gr);

Generated by  Doxygen 1.6.0   Back to index