summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e33f02)
raw | patch | inline | side by side (parent: 4e33f02)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Wed, 14 Nov 2007 21:07:46 +0000 (21:07 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Wed, 14 Nov 2007 21:07:46 +0000 (21:07 +0000) |
Furthermore it's also buggy currently (it messes up the grid snapping sensitivity), so I'm removing this functionality. If someone wants it back, we should rather round the paste offset to a multiple of the grid pitch. This way, something that was snapped to the grid before will stay snapped after pasting.
src/selection-chemistry.cpp | patch | blob | history | |
src/snap.cpp | patch | blob | history | |
src/snap.h | patch | blob | history |
index 95a2cac0df4ed5bf8386df7dc22b580591dee389..e5e2cdc0177d7e41dbe20d9ce917758037055e15 100644 (file)
m -= sel_bbox->midpoint();
}
- /* Snap the offset of the new item(s) to the grid */
- SnapManager &sm = desktop->namedview->snap_manager;
- SnapManager::SnapperList gs = sm.getGridSnappers();
- m = sm.freeSnapAlways(Inkscape::Snapper::SNAPPOINT_NODE, m, NULL, gs).getPoint();
sp_selection_move_relative(selection, m);
}
- sp_document_done(document, SP_VERB_EDIT_PASTE,
- _("Paste"));
+ sp_document_done(document, SP_VERB_EDIT_PASTE, _("Paste"));
}
void sp_selection_paste_style()
diff --git a/src/snap.cpp b/src/snap.cpp
index edc30e21a13ca1feae8fbd23f0993364eb551dbf..a6b91e07447a70ae60b306574516f22729e933b9 100644 (file)
--- a/src/snap.cpp
+++ b/src/snap.cpp
return findBestSnap(p, sc);
}
-/**
- * Try to snap a point to any of the specified snappers. Snap always, ignoring the snap-distance
- *
- * \param t Type of point.
- * \param p Point.
- * \param it Item to ignore when snapping.
- * \param snappers List of snappers to try to snap to
- * \return Snapped point.
- */
-
-Inkscape::SnappedPoint
-SnapManager::freeSnapAlways( Inkscape::Snapper::PointType t,
- NR::Point const &p,
- SPItem const *it,
- SnapperList &snappers )
-{
- std::list<SPItem const *> lit;
- lit.push_back(it);
- return freeSnapAlways(t, p, lit, snappers);
-}
-
-/**
- * Try to snap a point to any of the specified snappers. Snap always, ignoring the snap-distance
- *
- * \param t Type of point.
- * \param p Point.
- * \param it List of items to ignore when snapping.
- * \param snappers List of snappers to try to snap to
- * \return Snapped point.
- */
-
-Inkscape::SnappedPoint
-SnapManager::freeSnapAlways( Inkscape::Snapper::PointType t,
- NR::Point const &p,
- std::list<SPItem const *> const &it,
- SnapperList &snappers )
-{
-
- SnappedConstraints sc;
-
- for (SnapperList::iterator i = snappers.begin(); i != snappers.end(); i++) {
- gdouble const curr_gridsnap = (*i)->getDistance();
- const_cast<Inkscape::Snapper*> (*i)->setDistance(NR_HUGE);
- std::vector<NR::Point> points_to_snap;
- points_to_snap.push_back(p);
- (*i)->freeSnap(sc, t, p, true, points_to_snap, it);
- const_cast<Inkscape::Snapper*> (*i)->setDistance(curr_gridsnap);
- }
-
- return findBestSnap(p, sc);
-}
-
-
-
/**
* Try to snap a point to any interested snappers. A snap will only occur along
* a line described by a Inkscape::Snapper::ConstraintLine.
diff --git a/src/snap.h b/src/snap.h
index 88254430cd5e46b3acd711efa76ebe9dae734dbf..9547064a9663e931a48e1a92b1e982b5f4a3329b 100644 (file)
--- a/src/snap.h
+++ b/src/snap.h
std::vector<NR::Point> &points_to_snap,
std::list<SPItem const *> const &it) const;
- Inkscape::SnappedPoint freeSnapAlways( Inkscape::Snapper::PointType t,
- NR::Point const &p,
- SPItem const *it,
- SnapperList &snappers );
-
- Inkscape::SnappedPoint freeSnapAlways( Inkscape::Snapper::PointType t,
- NR::Point const &p,
- std::list<SPItem const *> const &it,
- SnapperList &snappers );
-
Inkscape::SnappedPoint constrainedSnap(Inkscape::Snapper::PointType t,
NR::Point const &p,
Inkscape::Snapper::ConstraintLine const &c,