summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-07-30 11:29:49 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-07-30 11:29:49 +0000
commit22c8b1726a2caed9b031705b18752043b40cfb05 (patch)
tree2a73d085a6e741e629e5941c7635345db76eaf1c /src
parentNew LPE: Text label (diff)
downloadinkscape-22c8b1726a2caed9b031705b18752043b40cfb05.tar.gz
inkscape-22c8b1726a2caed9b031705b18752043b40cfb05.zip
Add default mirroring line to lpe-symmetry because the on-canvas clicks seem more difficult to discover
(bzr r6473)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp25
-rw-r--r--src/live_effects/lpe-mirror_symmetry.h3
2 files changed, 12 insertions, 16 deletions
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index 39d3bfe30..a70ab507f 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -38,24 +38,23 @@ LPEMirrorSymmetry::LPEMirrorSymmetry(LivePathEffectObject *lpeobject) :
LPEMirrorSymmetry::~LPEMirrorSymmetry()
{
-
}
void
-LPEMirrorSymmetry::acceptParamPath (SPPath *param_path) {
+LPEMirrorSymmetry::doOnApply (SPLPEItem *lpeitem)
+{
using namespace Geom;
- SPCurve* curve = sp_path_get_curve_for_edit (param_path);
- Geom::Point A(curve->first_point());
- Geom::Point B(curve->last_point());
-
- Piecewise<D2<SBasis> > rline = Piecewise<D2<SBasis> >(D2<SBasis>(Linear(A[X], B[X]), Linear(A[Y], B[Y])));
- reflection_line.set_new_value( rline, true );
-
- SP_OBJECT(param_path)->deleteObject(true);
+ SPItem *item = SP_ITEM(lpeitem);
+ Geom::Matrix t = sp_item_i2d_affine(item);
+ NR::Maybe<Geom::Rect> bbox = item->getBounds(t);
- // don't remove this; needed for cleanup tasks
- Effect::acceptParamPath(param_path);
+ Point A(bbox->left(), bbox->bottom());
+ Point B(bbox->left(), bbox->top());
+ A *= t;
+ B *= t;
+ Piecewise<D2<SBasis> > rline = Piecewise<D2<SBasis> >(D2<SBasis>(Linear(A[X], B[X]), Linear(A[Y], B[Y])));
+ reflection_line.set_new_value(rline, true);
}
std::vector<Geom::Path>
@@ -90,8 +89,6 @@ LPEMirrorSymmetry::doEffect_path (std::vector<Geom::Path> const & path_in)
return path_out;
}
-/* ######################## */
-
} //namespace LivePathEffect
} /* namespace Inkscape */
diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h
index 40b0292c4..a37e0d45c 100644
--- a/src/live_effects/lpe-mirror_symmetry.h
+++ b/src/live_effects/lpe-mirror_symmetry.h
@@ -28,8 +28,7 @@ public:
LPEMirrorSymmetry(LivePathEffectObject *lpeobject);
virtual ~LPEMirrorSymmetry();
- virtual void acceptParamPath (SPPath *param_path);
- virtual int acceptsNumParams() { return 2; }
+ virtual void doOnApply (SPLPEItem *lpeitem);
virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in);