summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9fefe96)
raw | patch | inline | side by side (parent: 9fefe96)
author | cilix42 <cilix42@users.sourceforge.net> | |
Mon, 19 May 2008 17:02:06 +0000 (17:02 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Mon, 19 May 2008 17:02:06 +0000 (17:02 +0000) |
index 2e33098d23fe276583e2b79c1b7d22a8b09a9b91..906955575599d13fac395f6764148d2b7d9cc9c8 100644 (file)
Effect::Effect(LivePathEffectObject *lpeobject)
: oncanvasedit_it(0),
+ is_visible(_("Is visible?"), _("If unchecked, the effect remains applied to the object but is temporarily disabled on canvas"), "is_visible", &wr, this, true),
lpeobj(lpeobject),
concatenate_before_pwd2(false)
{
+ registerParameter( dynamic_cast<Parameter *>(&is_visible) );
}
Effect::~Effect()
index ad2d5126f3d6addb4b5ae882942822f70b338cb1..1255595d0522fa8804cf9679f08a0c435c1af6cf 100644 (file)
#include "util/enums.h"
#include "sp-lpe-item.h"
#include "knotholder.h"
+#include "parameter/bool.h"
#define LPE_CONVERSION_TOLERANCE 0.01 // FIXME: find good solution for this.
extern const Util::EnumData<EffectType> LPETypeData[INVALID_LPE];
extern const Util::EnumDataConverter<EffectType> LPETypeConverter;
-class Parameter;
-
class Effect {
public:
static Effect* New(EffectType lpenr, LivePathEffectObject *lpeobj);
void readallParameters(Inkscape::XML::Node * repr);
void setParameter(const gchar * key, const gchar * new_value);
+ inline bool isVisible() { return is_visible; }
+
void editNextParamOncanvas(SPItem * item, SPDesktop * desktop);
protected:
std::vector<Parameter *> param_vector;
std::vector<std::pair<SPKnotHolderSetFunc, SPKnotHolderGetFunc> > knotholder_func_vector;
int oncanvasedit_it;
+ BoolParam is_visible;
+
Inkscape::UI::Widget::Registry wr;
LivePathEffectObject *lpeobj;
diff --git a/src/object-edit.cpp b/src/object-edit.cpp
index 46ab877b6e2d39e71a10044c22c7bc90c525a1b1..091c997348abc04b930e8173ddd435b50037d93f 100644 (file)
--- a/src/object-edit.cpp
+++ b/src/object-edit.cpp
sp_item_knot_holder(SPItem *item, SPDesktop *desktop)
{
if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(item)) &&
+ sp_lpe_item_get_livepatheffect(SP_LPE_ITEM(item))->isVisible() &&
sp_lpe_item_get_livepatheffect(SP_LPE_ITEM(item))->providesKnotholder()) {
return sp_lpe_knot_holder(item, desktop);
} else
diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp
index f0bec7ba91ac88529a56f2ff098dd740fdbc976e..40e92e0dd0033565fa7b314b5e1e6f2481348db7 100644 (file)
--- a/src/shape-editor.cpp
+++ b/src/shape-editor.cpp
if (item) {
SPLPEItem *lpeitem = SP_LPE_ITEM(item);
if (!sp_lpe_item_has_path_effect(lpeitem) ||
+ !sp_lpe_item_get_livepatheffect(lpeitem)->isVisible() ||
!sp_lpe_item_get_livepatheffect(lpeitem)->providesKnotholder()) {
// only create nodepath if the item either doesn't have an LPE
- // or the LPE doesn't provide a knotholder itself
+ // or the LPE is invisible or it doesn't provide a knotholder itself
this->nodepath =
sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
}
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 87e737435ead7e1fcec0e6a8acbbf6adf0e8aa59..f16b455ddf33fe3d8c1a4efb283aa5bef57e853b 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
if (sp_lpe_item_has_path_effect(lpeitem)) {
LivePathEffectObject *lpeobj = sp_lpe_item_get_livepatheffectobject(lpeitem);
- lpeobj->lpe->doBeforeEffect(lpeitem);
- lpeobj->lpe->doEffect(curve);
+ if (lpeobj->lpe->isVisible()) {
+ lpeobj->lpe->doBeforeEffect(lpeitem);
+ lpeobj->lpe->doEffect(curve);
+ }
}
SPObject *parent = lpeitem->parent;