diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-07-19 07:14:43 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-07-19 07:14:43 +0000 |
| commit | 3792c590a31a9155ccb69279ca591de17fa2e3db (patch) | |
| tree | 6b668486e5e120eb4150ccc8b790cb6f9dd83170 /src/object-snapper.cpp | |
| parent | updated PO file (diff) | |
| download | inkscape-3792c590a31a9155ccb69279ca591de17fa2e3db.tar.gz inkscape-3792c590a31a9155ccb69279ca591de17fa2e3db.zip | |
Fix snapping to midpoints of closing segments
(bzr r9627)
Diffstat (limited to '')
| -rw-r--r-- | src/object-snapper.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 57d5b0fc5..7d593dfc4 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -13,6 +13,7 @@ #include "svg/svg.h" #include <2geom/path-intersection.h> +#include <2geom/pathvector.h> #include <2geom/point.h> #include <2geom/rect.h> #include <2geom/line.h> @@ -386,9 +387,14 @@ void Inkscape::ObjectSnapper::_collectPaths(Inkscape::SnapCandidatePoint const & if (!very_lenghty_prose && !very_complex_path) { SPCurve *curve = curve_for_item(root_item); if (curve) { - // We will get our own copy of the path, which must be freed at some point - Geom::PathVector *borderpathv = pathvector_for_curve(root_item, curve, true, true, Geom::identity(), (*i).additional_affine); - _paths_to_snap_to->push_back(Inkscape::SnapCandidatePath(borderpathv, SNAPTARGET_PATH, Geom::OptRect())); // Perhaps for speed, get a reference to the Geom::pathvector, and store the transformation besides it. + // We will get our own copy of the pathvector, which must be freed at some point + + // Geom::PathVector *pv = pathvector_for_curve(root_item, curve, true, true, Geom::identity(), (*i).additional_affine); + + Geom::PathVector *pv = new Geom::PathVector(curve->get_pathvector()); + (*pv) *= sp_item_i2d_affine(root_item) * (*i).additional_affine * _snapmanager->getDesktop()->doc2dt(); // (_edit_transform * _i2d_transform); + + _paths_to_snap_to->push_back(Inkscape::SnapCandidatePath(pv, SNAPTARGET_PATH, Geom::OptRect())); // Perhaps for speed, get a reference to the Geom::pathvector, and store the transformation besides it. curve->unref(); } } |
