summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-09-13 16:51:16 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-09-13 16:51:16 +0000
commit7b4d58faf59da2981349ebfacdbcdd64fc05f228 (patch)
tree59cec14d5c71b8942eb942e704c76e6577b946e8 /src
parentAdd option to align & distribute dialog to treat the selection as a group (cl... (diff)
downloadinkscape-7b4d58faf59da2981349ebfacdbcdd64fc05f228.tar.gz
inkscape-7b4d58faf59da2981349ebfacdbcdd64fc05f228.zip
Hide canvas text, too, when lpe-path-length is invisible
(bzr r6801)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-path_length.cpp6
-rw-r--r--src/live_effects/lpe-path_length.h2
-rw-r--r--src/sp-lpe-item.cpp14
3 files changed, 22 insertions, 0 deletions
diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp
index 3b9b07c82..5ecf2ffa2 100644
--- a/src/live_effects/lpe-path_length.cpp
+++ b/src/live_effects/lpe-path_length.cpp
@@ -34,6 +34,12 @@ LPEPathLength::~LPEPathLength()
}
+bool
+LPEPathLength::hideCanvasText() {
+ // this is only used in sp-lpe-item.cpp to hide the canvas text when the effect is invisible
+ info_text.param_setValue("");
+}
+
Geom::Piecewise<Geom::D2<Geom::SBasis> >
LPEPathLength::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
{
diff --git a/src/live_effects/lpe-path_length.h b/src/live_effects/lpe-path_length.h
index 1ec5165e9..5a4638d90 100644
--- a/src/live_effects/lpe-path_length.h
+++ b/src/live_effects/lpe-path_length.h
@@ -28,6 +28,8 @@ public:
virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
+ bool hideCanvasText();
+
private:
LPEPathLength(const LPEPathLength&);
LPEPathLength& operator=(const LPEPathLength&);
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 6e2e65d7d..56ffd190c 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -18,6 +18,7 @@
#endif
#include "live_effects/effect.h"
+#include "live_effects/lpe-path_length.h"
#include "live_effects/lpeobject.h"
#include "live_effects/lpeobject-reference.h"
@@ -353,6 +354,19 @@ sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write)
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) {
+ Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->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) {