summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-mirror_symmetry.cpp
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/live_effects/lpe-mirror_symmetry.cpp
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/live_effects/lpe-mirror_symmetry.cpp')
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp25
1 files changed, 11 insertions, 14 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 */