diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-06-12 13:23:17 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-06-12 13:23:17 +0000 |
| commit | e2ebbb4f9c51fd4d4528899b761afe74f6f4dd42 (patch) | |
| tree | cf08b1b3a2d345c346a14a2f203dd0e64cc2f174 /src/sp-lpe-item.cpp | |
| parent | Pen context can now wait for a specified number of clicks and finish the path... (diff) | |
| download | inkscape-e2ebbb4f9c51fd4d4528899b761afe74f6f4dd42.tar.gz inkscape-e2ebbb4f9c51fd4d4528899b761afe74f6f4dd42.zip | |
Infrastructure in class LivePathEffect::Effect to put Inkscape into 'wait for parameter path' mode; make LPEMirrorReflect use this to let the user specify the mirroring line
(bzr r5902)
Diffstat (limited to 'src/sp-lpe-item.cpp')
| -rw-r--r-- | src/sp-lpe-item.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 3bf5a28ee..9013eb863 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -286,13 +286,20 @@ void sp_lpe_item_perform_path_effect(SPLPEItem *lpeitem, SPCurve *curve) { return; } - if (lpeobj->lpe->isVisible()) { + Inkscape::LivePathEffect::Effect *lpe = lpeobj->lpe; + if (lpe->isVisible()) { + if (lpe->acceptsNumParams() > 0 && !lpe->pathParamAccepted()) { + // if the effect expects mouse input before being applied and the input is not finished + // yet, we don't alter the path + return; + } + // Groups have their doBeforeEffect called elsewhere if (!SP_IS_GROUP(lpeitem)) { - lpeobj->lpe->doBeforeEffect(lpeitem); + lpe->doBeforeEffect(lpeitem); } - lpeobj->lpe->doEffect(curve); + lpe->doEffect(curve); } } } @@ -430,13 +437,21 @@ void sp_lpe_item_add_path_effect(SPLPEItem *lpeitem, gchar *value, bool reset) LivePathEffectObject *lpeobj = lpeitem->path_effect_list->back()->lpeobject; if (lpeobj && lpeobj->lpe) { + Inkscape::LivePathEffect::Effect *lpe = lpeobj->lpe; // Ask the path effect to reset itself if it doesn't have parameters yet if (reset) { // has to be called when all the subitems have their lpes applied - lpeobj->lpe->resetDefaults(lpeitem); + lpe->resetDefaults(lpeitem); + } + + // perform this once when the effect is applied + lpe->doOnApply(SP_LPE_ITEM(lpeitem)); + + // if the effect expects a number of mouse clicks to set a parameter path, perform the + // necessary preparations + if (lpe->acceptsNumParams() > 0) { + lpe->doAcceptPathPreparations(lpeitem); } - /* perform this once when the effect is applied */ - lpeobj->lpe->doOnApply(SP_LPE_ITEM(lpeitem)); } //Enable the path effects now that everything is ready to apply the new path effect |
