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

void sp_item_adjust_paint_recursive ( SPItem item,
Geom::Matrix  advertized_transform,
Geom::Matrix  t_ancestors,
bool  is_pattern 

Recursively compensate pattern or gradient transform.

Definition at line 1335 of file sp-item.cpp.

References Geom::Matrix::inverse(), sp_item_adjust_gradient(), sp_item_adjust_paint_recursive(), and sp_item_transform_repr().

Referenced by sp_item_adjust_paint_recursive(), and sp_item_write_transform().

// _Before_ full pattern/gradient transform: t_paint * t_item * t_ancestors
// _After_ full pattern/gradient transform: t_paint_new * t_item * t_ancestors * advertised_transform
// By equating these two expressions we get t_paint_new = t_paint * paint_delta, where:
    Geom::Matrix t_item = sp_item_transform_repr (item);
    Geom::Matrix paint_delta = t_item * t_ancestors * advertized_transform * t_ancestors.inverse() * t_item.inverse();

// Within text, we do not fork gradients, and so must not recurse to avoid double compensation;
// also we do not recurse into clones, because a clone's child is the ghost of its original -
// we must not touch it
    if (!(item && (SP_IS_TEXT(item) || SP_IS_USE(item)))) {
        for (SPObject *o = item->children; o != NULL; o = o->next) {
            if (SP_IS_ITEM(o)) {
// At the level of the transformed item, t_ancestors is identity;
// below it, it is the accmmulated chain of transforms from this level to the top level
                sp_item_adjust_paint_recursive (SP_ITEM(o), advertized_transform, t_item * t_ancestors, is_pattern);

// We recursed into children first, and are now adjusting this object second;
// this is so that adjustments in a tree are done from leaves up to the root,
// and paintservers on leaves inheriting their values from ancestors could adjust themselves properly
// before ancestors themselves are adjusted, probably differently (bug 1286535)

    if (is_pattern)
        sp_item_adjust_pattern (item, paint_delta);
        sp_item_adjust_gradient (item, paint_delta);


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