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

void sp_lpe_item_update_patheffect ( SPLPEItem *  lpeitem,
bool  wholetree,
bool  write 
)

Calls any registered handlers for the update_patheffect action

Definition at line 363 of file sp-lpe-item.cpp.

References SPObject::parent.

Referenced by lpeobject_ref_modified(), and sp_lpe_item_modified().

{
#ifdef SHAPE_VERBOSE
    g_message("sp_lpe_item_update_patheffect: %p\n", lpeitem);
#endif
    g_return_if_fail (lpeitem != NULL);
    g_return_if_fail (SP_IS_LPE_ITEM (lpeitem));

    if (!sp_lpe_item_path_effects_enabled(lpeitem))
        return;

    // TODO: hack! this will be removed when path length measuring is reimplemented in a better way
    PathEffectList lpelist = sp_lpe_item_get_effect_list(lpeitem);
    std::list<Inkscape::LivePathEffect::LPEObjectReference *>::iterator i;
    for (i = lpelist.begin(); i != lpelist.end(); ++i) {
        if ((*i)->lpeobject) {
            Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->get_lpe();
            if (dynamic_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)) {
                if (!lpe->isVisible()) {
                    // we manually disable text for LPEPathLength
                    dynamic_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)->hideCanvasText();
                }
            }
        }
    }

    SPLPEItem *top;

    if (wholetree) {
        SPObject *prev_parent = lpeitem;
        SPObject *parent = prev_parent->parent;
        while (parent && SP_IS_LPE_ITEM(parent) && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(parent))) {
            prev_parent = parent;
            parent = prev_parent->parent;
        }
        top = SP_LPE_ITEM(prev_parent);
    }
    else {
        top = lpeitem;
    }

    if (SP_LPE_ITEM_CLASS (G_OBJECT_GET_CLASS (top))->update_patheffect) {
        SP_LPE_ITEM_CLASS (G_OBJECT_GET_CLASS (top))->update_patheffect (top, write);
    }
}


Generated by  Doxygen 1.6.0   Back to index