summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b59f7e)
raw | patch | inline | side by side (parent: 4b59f7e)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Fri, 11 Apr 2008 08:03:13 +0000 (08:03 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Fri, 11 Apr 2008 08:03:13 +0000 (08:03 +0000) |
diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp
index 219bc7482d7501c54d6259087a488acce0d64d0f..b9974c2c04cafdbde915fe954c3a85716ab3b914 100644 (file)
--- a/src/line-snapper.cpp
+++ b/src/line-snapper.cpp
NR::Point const &p,
bool const &f,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const
{
/* Get the lines that we will try to snap to */
bool const &/*f*/,
std::vector<NR::Point> &/*points_to_snap*/,
ConstraintLine const &c,
- std::list<SPItem const *> const &/*it*/) const
+ std::vector<SPItem const *> const &/*it*/) const
{
/* Get the lines that we will try to snap to */
diff --git a/src/line-snapper.h b/src/line-snapper.h
index c1c7da39a7dbc2bba44eddec414345efcec287a7..39df820571cedae35a5cd5498b6ef077241697f5 100644 (file)
--- a/src/line-snapper.h
+++ b/src/line-snapper.h
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const;
void _doConstrainedSnap(SnappedConstraints &sc,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
ConstraintLine const &c,
- std::list<SPItem const *> const &it) const;
+ std::vector<SPItem const *> const &it) const;
/**
* \param p Point that we are trying to snap.
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 9d4745bfea933fc42b49e61e2231e388256fbb59..8c728cd977ba8cf0899f235a1f73eae2f6010671 100644 (file)
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
*/
void Inkscape::ObjectSnapper::_findCandidates(SPObject* r,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
DimensionToSnap const snap_dim) const
if (SP_IS_ITEM(o) && !SP_ITEM(o)->isLocked() && !desktop->itemIsHidden(SP_ITEM(o))) {
/* See if this item is on the ignore list */
- std::list<SPItem const *>::const_iterator i = it.begin();
+ std::vector<SPItem const *>::const_iterator i = it.begin();
while (i != it.end() && *i != o) {
i++;
}
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const
{
if ( NULL == _named_view ) {
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
ConstraintLine const &c,
- std::list<SPItem const *> const &it) const
+ std::vector<SPItem const *> const &it) const
{
if ( NULL == _named_view ) {
return;
/* Get a list of all the SPItems that we will try to snap to */
std::vector<SPItem*> cand;
- std::list<SPItem const *> const it; //just an empty list
+ std::vector<SPItem const *> const it; //just an empty list
std::vector<NR::Point> points_to_snap;
points_to_snap.push_back(p);
diff --git a/src/object-snapper.h b/src/object-snapper.h
index 924c94e07725925242f884dbcb4d2a567f518fd7..29f5954246a7a2cf8e37182f28c712c14b7ad49f 100644 (file)
--- a/src/object-snapper.h
+++ b/src/object-snapper.h
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const;
void _doConstrainedSnap(SnappedConstraints &sc,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
ConstraintLine const &c,
- std::list<SPItem const *> const &it) const;
+ std::vector<SPItem const *> const &it) const;
void _findCandidates(SPObject* r,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
DimensionToSnap snap_dim) const;
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index d248d31522e55c5d3e48f485899502828bf5fadf..154e828c41bd5eab90cfe7c3258fef92787f191e 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
}
for (unsigned i = 0; i < _items.size(); i++) {
- sp_object_unref(SP_OBJECT(_items[i].first), NULL);
+ sp_object_unref(SP_OBJECT(_items[i]), NULL);
}
_items.clear();
+ _items_const.clear();
+ _items_affines.clear();
_items_centers.clear();
}
@@ -263,9 +265,11 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho
}
for (GSList const *l = selection->itemList(); l; l = l->next) {
- SPItem *it = (SPItem*)sp_object_ref(SP_OBJECT(l->data), NULL);
- _items.push_back(std::pair<SPItem *, NR::Matrix>(it, sp_item_i2d_affine(it)));
- _items_centers.push_back(std::pair<SPItem *, NR::Point>(it, it->getCenter())); // for content-dragging, we need to remember original centers
+ SPItem *it = (SPItem *)sp_object_ref(SP_OBJECT(l->data), NULL);
+ _items.push_back(it);
+ _items_const.push_back(it);
+ _items_affines.push_back(sp_item_i2d_affine(it));
+ _items_centers.push_back(it->getCenter()); // for content-dragging, we need to remember original centers
}
_handle_x = x;
@@ -366,8 +370,8 @@ void Inkscape::SelTrans::transform(NR::Matrix const &rel_affine, NR::Point const
if (_show == SHOW_CONTENT) {
// update the content
for (unsigned i = 0; i < _items.size(); i++) {
- SPItem &item = *_items[i].first;
- NR::Matrix const &prev_transform = _items[i].second;
+ SPItem &item = *_items[i];
+ NR::Matrix const &prev_transform = _items_affines[i];
sp_item_set_i2d_affine(&item, prev_transform * affine);
}
} else {
_updateVolatileState();
for (unsigned i = 0; i < _items.size(); i++) {
- sp_object_unref(SP_OBJECT(_items[i].first), NULL);
+ sp_object_unref(SP_OBJECT(_items[i]), NULL);
}
sp_canvas_item_hide(_norm);
// the new bboxes). So we need to reset the centers from our saved array.
if (_show != SHOW_OUTLINE && !_current_relative_affine.is_translation()) {
for (unsigned i = 0; i < _items_centers.size(); i++) {
- SPItem *currentItem = _items_centers[i].first;
+ SPItem *currentItem = _items[i];
if (currentItem->isCenterSet()) { // only if it's already set
- currentItem->setCenter (_items_centers[i].second * _current_relative_affine);
+ currentItem->setCenter (_items_centers[i] * _current_relative_affine);
SP_OBJECT(currentItem)->updateRepr();
}
}
}
_items.clear();
+ _items_const.clear();
+ _items_affines.clear();
_items_centers.clear();
if (_current_relative_affine.is_translation()) {
}
_items.clear();
+ _items_const.clear();
+ _items_affines.clear();
_items_centers.clear();
_updateHandles();
}
@@ -766,7 +774,7 @@ void Inkscape::SelTrans::handleNewEvent(SPKnot *knot, NR::Point *position, guint
// in case items have been unhooked from the document, don't
// try to continue processing events for them.
for (unsigned int i = 0; i < _items.size(); i++) {
- if (!SP_OBJECT_DOCUMENT(SP_OBJECT(_items[i].first)) ) {
+ if (!SP_OBJECT_DOCUMENT(SP_OBJECT(_items[i])) ) {
return;
}
}
// In all other cases we should try to snap now
SnapManager const &m = _desktop->namedview->snap_manager;
- /* Get a STL list of the selected items.
- ** FIXME: this should probably be done by Inkscape::Selection.
- */
- std::list<SPItem const*> it;
- for (GSList const *i = _selection->itemList(); i != NULL; i = i->next) {
- it.push_back(reinterpret_cast<SPItem*>(i->data));
- }
-
Inkscape::SnappedPoint bb, sn;
NR::Coord bd(NR_HUGE);
NR::Coord sd(NR_HUGE);
}
// Snap along a suitable constraint vector from the origin.
- bb = m.constrainedSnapScale(Snapper::SNAPPOINT_BBOX, _bbox_points, it, default_scale, _origin_for_bboxpoints);
- sn = m.constrainedSnapScale(Snapper::SNAPPOINT_NODE, _snap_points, it, geom_scale, _origin_for_specpoints);
+ bb = m.constrainedSnapScale(Snapper::SNAPPOINT_BBOX, _bbox_points, _items_const, default_scale, _origin_for_bboxpoints);
+ sn = m.constrainedSnapScale(Snapper::SNAPPOINT_NODE, _snap_points, _items_const, geom_scale, _origin_for_specpoints);
/* Choose the smaller difference in scale. Since s[X] == s[Y] we can
** just compare difference in s[X].
sd = sn.getSnapped() ? fabs(sn.getTransformation()[NR::X] - geom_scale[NR::X]) : NR_HUGE;
} else {
/* Scale aspect ratio is unlocked */
- bb = m.freeSnapScale(Snapper::SNAPPOINT_BBOX, _bbox_points, it, default_scale, _origin_for_bboxpoints);
- sn = m.freeSnapScale(Snapper::SNAPPOINT_NODE, _snap_points, it, geom_scale, _origin_for_specpoints);
+ bb = m.freeSnapScale(Snapper::SNAPPOINT_BBOX, _bbox_points, _items_const, default_scale, _origin_for_bboxpoints);
+ sn = m.freeSnapScale(Snapper::SNAPPOINT_NODE, _snap_points, _items_const, geom_scale, _origin_for_specpoints);
/* Pick the snap that puts us closest to the original scale */
bd = bb.getSnapped() ? fabs(NR::L2(bb.getTransformation()) - NR::L2(default_scale.point())) : NR_HUGE;
@@ -1022,14 +1022,6 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR::
} else {
// In all other cases we should try to snap now
- /* Get a STL list of the selected items.
- ** FIXME: this should probably be done by Inkscape::Selection.
- */
- std::list<SPItem const*> it;
- for (GSList const *i = _selection->itemList(); i != NULL; i = i->next) {
- it.push_back(reinterpret_cast<SPItem*>(i->data));
- }
-
SnapManager const &m = _desktop->namedview->snap_manager;
Inkscape::SnappedPoint bb, sn;
@@ -1039,8 +1031,8 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR::
bool symmetrical = state & GDK_CONTROL_MASK;
- bb = m.constrainedSnapStretch(Snapper::SNAPPOINT_BBOX, _bbox_points, it, default_scale[axis], _origin_for_bboxpoints, axis, symmetrical);
- sn = m.constrainedSnapStretch(Snapper::SNAPPOINT_NODE, _snap_points, it, geom_scale[axis], _origin_for_specpoints, axis, symmetrical);
+ bb = m.constrainedSnapStretch(Snapper::SNAPPOINT_BBOX, _bbox_points, _items_const, default_scale[axis], _origin_for_bboxpoints, axis, symmetrical);
+ sn = m.constrainedSnapStretch(Snapper::SNAPPOINT_NODE, _snap_points, _items_const, geom_scale[axis], _origin_for_specpoints, axis, symmetrical);
if (bb.getSnapped()) {
// We snapped the bbox (which is either visual or geometric)
@@ -1149,20 +1141,12 @@ gboolean Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, NR::Poi
} else {
// Snap to objects, grids, guides
- /* Get a STL list of the selected items.
- ** FIXME: this should probably be done by Inkscape::Selection.
- */
- std::list<SPItem const*> it;
- for (GSList const *i = _selection->itemList(); i != NULL; i = i->next) {
- it.push_back(reinterpret_cast<SPItem*>(i->data));
- }
-
SnapManager const &m = _desktop->namedview->snap_manager;
//TODO: While skewing, scaling in the opposite direction by integer multiples is also allowed. This is not handled though by freeSnapSkew / _snapTransformed yet!
//TODO: We need a constrainedSnapSkew instead of a freeSnapSkew
- Inkscape::SnappedPoint bb = m.freeSnapSkew(Inkscape::Snapper::SNAPPOINT_BBOX, _bbox_points, it, skew[dim_a], _origin, dim_b);
- Inkscape::SnappedPoint sn = m.freeSnapSkew(Inkscape::Snapper::SNAPPOINT_NODE, _snap_points, it, skew[dim_a], _origin, dim_b);
+ Inkscape::SnappedPoint bb = m.freeSnapSkew(Inkscape::Snapper::SNAPPOINT_BBOX, _bbox_points, _items_const, skew[dim_a], _origin, dim_b);
+ Inkscape::SnappedPoint sn = m.freeSnapSkew(Inkscape::Snapper::SNAPPOINT_NODE, _snap_points, _items_const, skew[dim_a], _origin, dim_b);
if (bb.getSnapped() || sn.getSnapped()) {
// We snapped something, so change the skew to reflect it
/* The amount that we've moved by during this drag */
NR::Point dxy = xy - _point;
- /* Get a STL list of the selected items.
- ** FIXME: this should probably be done by Inkscape::Selection.
- */
- std::list<SPItem const*> it;
- for (GSList const *i = _selection->itemList(); i != NULL; i = i->next) {
- it.push_back(reinterpret_cast<SPItem*>(i->data));
- }
-
bool const alt = (state & GDK_MOD1_MASK);
bool const control = (state & GDK_CONTROL_MASK);
bool const shift = (state & GDK_SHIFT_MASK);
for (unsigned int dim = 0; dim < 2; dim++) {
s.push_back(m.constrainedSnapTranslation(Inkscape::Snapper::SNAPPOINT_BBOX,
_bbox_points,
- it,
+ _items_const,
Inkscape::Snapper::ConstraintLine(component_vectors[dim]),
dxy));
s.push_back(m.constrainedSnapTranslation(Inkscape::Snapper::SNAPPOINT_NODE,
_snap_points,
- it,
+ _items_const,
Inkscape::Snapper::ConstraintLine(component_vectors[dim]),
dxy));
}
/* Snap to things with no constraint */
s.push_back(m.freeSnapTranslation(Inkscape::Snapper::SNAPPOINT_BBOX,
- _bbox_points, it, dxy));
+ _bbox_points, _items_const, dxy));
s.push_back(m.freeSnapTranslation(Inkscape::Snapper::SNAPPOINT_NODE,
- _snap_points, it, dxy));
+ _snap_points, _items_const, dxy));
/*g_get_current_time(&endtime);
double elapsed = ((((double)endtime.tv_sec - starttime.tv_sec) * G_USEC_PER_SEC + (endtime.tv_usec - starttime.tv_usec))) / 1000.0;
diff --git a/src/seltrans.h b/src/seltrans.h
index 00d7fb1c494dcd865184cb580385cff42ead8348..d06e0527626c7629ae65dc227ead958ffead6c73 100644 (file)
--- a/src/seltrans.h
+++ b/src/seltrans.h
SPDesktop *_desktop;
- std::vector<std::pair<SPItem *, NR::Matrix> > _items;
- std::vector<std::pair<SPItem *, NR::Point> > _items_centers;
+ std::vector<SPItem *> _items;
+ std::vector<SPItem const *> _items_const;
+ std::vector<NR::Matrix> _items_affines;
+ std::vector<NR::Point> _items_centers;
std::vector<NR::Point> _snap_points;
std::vector<NR::Point> _bbox_points;
diff --git a/src/snap.cpp b/src/snap.cpp
index 76bda92822f9a2cb708d34163049291a54df1373..2d23a7745458ccb176c56becb561f357a58d7205 100644 (file)
--- a/src/snap.cpp
+++ b/src/snap.cpp
NR::Maybe<NR::Point> point_not_to_snap_to) const
{
- std::list<SPItem const *> lit;
- lit.push_back(it);
+ std::vector<SPItem const *> lit;
+ if (it) {
+ lit.push_back(it);
+ }
std::vector<NR::Point> points_to_snap;
points_to_snap.push_back(p);
std::vector<NR::Point> *unselected_nodes) const
{
- std::list<SPItem const *> lit;
- lit.push_back(it);
+ std::vector<SPItem const *> lit;
+ if (it) {
+ lit.push_back(it);
+ }
std::vector<NR::Point> points_to_snap;
points_to_snap.push_back(p);
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const
{
if (!SomeSnapperMightSnap()) {
@@ -266,8 +270,10 @@ Inkscape::SnappedPoint SnapManager::constrainedSnap(Inkscape::Snapper::PointType
Inkscape::Snapper::ConstraintLine const &c,
SPItem const *it) const
{
- std::list<SPItem const *> lit;
- lit.push_back(it);
+ std::vector<SPItem const *> lit;
+ if (it) {
+ lit.push_back(it);
+ }
std::vector<NR::Point> points_to_snap;
points_to_snap.push_back(p);
@@ -295,7 +301,7 @@ Inkscape::SnappedPoint SnapManager::constrainedSnap(Inkscape::Snapper::PointType
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
Inkscape::Snapper::ConstraintLine const &c,
- std::list<SPItem const *> const &it) const
+ std::vector<SPItem const *> const &it) const
{
if (!SomeSnapperMightSnap()) {
return Inkscape::SnappedPoint(p, NR_HUGE, 0, false);
Inkscape::SnappedPoint SnapManager::_snapTransformed(
Inkscape::Snapper::PointType type,
std::vector<NR::Point> const &points,
- std::list<SPItem const *> const &ignore,
+ std::vector<SPItem const *> const &ignore,
bool constrained,
Inkscape::Snapper::ConstraintLine const &constraint,
Transformation transformation_type,
Inkscape::SnappedPoint SnapManager::freeSnapTranslation(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::Point const &tr) const
{
return _snapTransformed(t, p, it, false, NR::Point(), TRANSLATION, tr, NR::Point(), NR::X, false);
@@ -615,7 +621,7 @@ Inkscape::SnappedPoint SnapManager::freeSnapTranslation(Inkscape::Snapper::Point
Inkscape::SnappedPoint SnapManager::constrainedSnapTranslation(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
Inkscape::Snapper::ConstraintLine const &c,
NR::Point const &tr) const
{
@@ -637,7 +643,7 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapTranslation(Inkscape::Snapper
Inkscape::SnappedPoint SnapManager::freeSnapScale(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::scale const &s,
NR::Point const &o) const
{
@@ -660,7 +666,7 @@ Inkscape::SnappedPoint SnapManager::freeSnapScale(Inkscape::Snapper::PointType t
Inkscape::SnappedPoint SnapManager::constrainedSnapScale(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::scale const &s,
NR::Point const &o) const
{
@@ -685,7 +691,7 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapScale(Inkscape::Snapper::Poin
Inkscape::SnappedPoint SnapManager::constrainedSnapStretch(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::Coord const &s,
NR::Point const &o,
NR::Dim2 d,
@@ -710,7 +716,7 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapStretch(Inkscape::Snapper::Po
Inkscape::SnappedPoint SnapManager::freeSnapSkew(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::Coord const &s,
NR::Point const &o,
NR::Dim2 d) const
diff --git a/src/snap.h b/src/snap.h
index 8bab5b0cf1d951b7c8f23a0918e008cd4964a9ce..0de8902f45daa676ffea026c2a965e112d76e5d6 100644 (file)
--- a/src/snap.h
+++ b/src/snap.h
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const;
Inkscape::SnappedPoint constrainedSnap(Inkscape::Snapper::PointType t,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
Inkscape::Snapper::ConstraintLine const &c,
- std::list<SPItem const *> const &it) const;
+ std::vector<SPItem const *> const &it) const;
Inkscape::SnappedPoint guideSnap(NR::Point const &p,
NR::Point const &guide_normal) const;
Inkscape::SnappedPoint freeSnapTranslation(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::Point const &tr) const;
Inkscape::SnappedPoint constrainedSnapTranslation(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
Inkscape::Snapper::ConstraintLine const &c,
NR::Point const &tr) const;
Inkscape::SnappedPoint freeSnapScale(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::scale const &s,
NR::Point const &o) const;
Inkscape::SnappedPoint constrainedSnapScale(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::scale const &s,
NR::Point const &o) const;
Inkscape::SnappedPoint constrainedSnapStretch(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::Coord const &s,
NR::Point const &o,
NR::Dim2 d,
Inkscape::SnappedPoint freeSnapSkew(Inkscape::Snapper::PointType t,
std::vector<NR::Point> const &p,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
NR::Coord const &s,
NR::Point const &o,
NR::Dim2 d) const;
Inkscape::SnappedPoint _snapTransformed(Inkscape::Snapper::PointType type,
std::vector<NR::Point> const &points,
- std::list<SPItem const *> const &ignore,
+ std::vector<SPItem const *> const &ignore,
bool constrained,
Inkscape::Snapper::ConstraintLine const &constraint,
Transformation transformation_type,
diff --git a/src/snapper.cpp b/src/snapper.cpp
index 31a96a8716868c21fe052b0718157833b41d942a..803506e7641d88c6468541200b5433546b582ef9 100644 (file)
--- a/src/snapper.cpp
+++ b/src/snapper.cpp
std::vector<NR::Point> &points_to_snap,
SPItem const *it) const
{
- std::list<SPItem const *> lit;
+ std::vector<SPItem const *> lit;
if (it) {
lit.push_back(it);
}
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const
{
if (_snap_enabled == false || getSnapFrom(t) == false) {
ConstraintLine const &c,
SPItem const *it) const
{
- std::list<SPItem const *> lit;
- lit.push_back(it);
+ std::vector<SPItem const *> lit;
+ if (it) {
+ lit.push_back(it);
+ }
constrainedSnap(sc, t, p, first_point, points_to_snap, c, lit);
}
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
ConstraintLine const &c,
- std::list<SPItem const *> const &it) const
+ std::vector<SPItem const *> const &it) const
{
if (_snap_enabled == false || getSnapFrom(t) == false) {
return;
diff --git a/src/snapper.h b/src/snapper.h
index 508ba7b9ad91dee834c396c82465c34bed2f16c6..cad4200ab6e0e237c72af4c8ef9f7e8fa782ed78 100644 (file)
--- a/src/snapper.h
+++ b/src/snapper.h
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const;
class ConstraintLine
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
ConstraintLine const &c,
- std::list<SPItem const *> const &it) const;
+ std::vector<SPItem const *> const &it) const;
protected:
SPNamedView const *_named_view;
NR::Point const &p,
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
- std::list<SPItem const *> const &it,
+ std::vector<SPItem const *> const &it,
std::vector<NR::Point> *unselected_nodes) const = 0;
/**
bool const &first_point,
std::vector<NR::Point> &points_to_snap,
ConstraintLine const &c,
- std::list<SPItem const *> const &it) const = 0;
+ std::vector<SPItem const *> const &it) const = 0;
};
}