diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-08-09 09:58:51 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-08-09 09:58:51 +0000 |
| commit | e5143d65bb57d4ce623e6220585b099e6d2ee453 (patch) | |
| tree | 4ff78f6fa8f0c1b740fd43b0ade2b91dbf9226d0 /src/object-snapper.cpp | |
| parent | Remove deprecated Autotools and btool files. Please use CMake instead (diff) | |
| parent | Merged trunk (diff) | |
| download | inkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.tar.gz inkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.zip | |
Merged gsoc work. Created better data structure for selections, replaced SPObject children list, improved spray tool, split tests to separate executables
(bzr r15047)
Diffstat (limited to 'src/object-snapper.cpp')
| -rw-r--r-- | src/object-snapper.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index af33415a1..b4f4024cc 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -84,9 +84,9 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent, Geom::Rect bbox_to_snap_incl = bbox_to_snap; // _incl means: will include the snapper tolerance bbox_to_snap_incl.expandBy(getSnapperTolerance()); // see? - for ( SPObject *o = parent->firstChild(); o; o = o->getNext() ) { + for (auto& o: parent->children) { g_assert(dt != NULL); - SPItem *item = dynamic_cast<SPItem *>(o); + SPItem *item = dynamic_cast<SPItem *>(&o); if (item && !(dt->itemIsHidden(item) && !clip_or_mask)) { // Snapping to items in a locked layer is allowed // Don't snap to hidden objects, unless they're a clipped path or a mask @@ -94,7 +94,7 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent, std::vector<SPItem const *>::const_iterator i; if (it != NULL) { i = it->begin(); - while (i != it->end() && *i != o) { + while (i != it->end() && *i != &o) { ++i; } } @@ -116,7 +116,7 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent, } if (dynamic_cast<SPGroup *>(item)) { - _findCandidates(o, it, false, bbox_to_snap, clip_or_mask, additional_affine); + _findCandidates(&o, it, false, bbox_to_snap, clip_or_mask, additional_affine); } else { Geom::OptRect bbox_of_item; Preferences *prefs = Preferences::get(); |
