diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-07-03 18:53:39 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-07-03 18:53:39 +0000 |
| commit | b3e8b69d72b193cffe4b5e1be228f63769b5398d (patch) | |
| tree | 96c38c7bf7df9a99e3fd3867378b41d4e89f4855 /src/seltrans.cpp | |
| parent | Added xmlNodes as range function (diff) | |
| parent | avoid zero SBasis curve. (Bug 1593963) (diff) | |
| download | inkscape-b3e8b69d72b193cffe4b5e1be228f63769b5398d.tar.gz inkscape-b3e8b69d72b193cffe4b5e1be228f63769b5398d.zip | |
Added items as a range function
(bzr r14954.1.13)
Diffstat (limited to 'src/seltrans.cpp')
| -rw-r--r-- | src/seltrans.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 9fa6172ed..f6cb9166c 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -240,8 +240,8 @@ void Inkscape::SelTrans::setCenter(Geom::Point const &p) _center_is_set = true; // Write the new center position into all selected items - std::vector<SPItem*> items= _desktop->selection->items(); - for ( std::vector<SPItem*>::const_iterator iter=items.begin();iter!=items.end(); ++iter) { + auto items= _desktop->selection->items(); + for (auto iter=items.begin();iter!=items.end(); ++iter) { SPItem *it = SP_ITEM(*iter); it->setCenter(p); // only set the value; updating repr and document_done will be done once, on ungrab @@ -270,8 +270,8 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s return; } - std::vector<SPItem*> items= _desktop->selection->items(); - for ( std::vector<SPItem*>::const_iterator iter=items.begin();iter!=items.end(); ++iter) { + auto items= _desktop->selection->items(); + for (auto iter=items.begin();iter!=items.end(); ++iter) { SPItem *it = static_cast<SPItem*>(sp_object_ref(*iter, NULL)); _items.push_back(it); _items_const.push_back(it); @@ -492,8 +492,8 @@ void Inkscape::SelTrans::ungrab() if (_center_is_set) { // we were dragging center; update reprs and commit undoable action - std::vector<SPItem*> items= _desktop->selection->items(); - for ( std::vector<SPItem*>::const_iterator iter=items.begin();iter!=items.end(); ++iter) { + auto items= _desktop->selection->items(); + for (auto iter=items.begin();iter!=items.end(); ++iter) { SPItem *it = *iter; it->updateRepr(); } @@ -529,8 +529,8 @@ void Inkscape::SelTrans::stamp() l = _stamp_cache; } else { /* Build cache */ - l = selection->items(); - sort(l.begin(),l.end(),sp_object_compare_position_bool); + l.insert(l.end(), selection->items().begin(), selection->items().end()); + sort(l.begin(), l.end(), sp_object_compare_position_bool); _stamp_cache = l; } @@ -621,7 +621,8 @@ void Inkscape::SelTrans::_updateVolatileState() return; } - _strokewidth = stroke_average_width (selection->items()); + std::vector<SPItem *> vec(selection->items().begin(), selection->items().end()); + _strokewidth = stroke_average_width(vec); } void Inkscape::SelTrans::_showHandles(SPSelTransType type) @@ -711,8 +712,8 @@ void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHa case HANDLE_CENTER: if (state & GDK_SHIFT_MASK) { // Unset the center position for all selected items - std::vector<SPItem*> items= _desktop->selection->items(); - for ( std::vector<SPItem*>::const_iterator iter=items.begin();iter!=items.end(); ++iter) { + auto items = _desktop->selection->items(); + for (auto iter=items.begin();iter!=items.end(); ++iter) { SPItem *it = *iter; it->unsetCenter(); it->updateRepr(); @@ -1287,7 +1288,7 @@ gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state) // items will share a single center. While dragging that single center, it should never snap to the // centers of any of the selected objects. Therefore we will have to pass the list of selected items // to the snapper, to avoid self-snapping of the rotation center - std::vector<SPItem*> items = const_cast<Selection *>(_selection)->items(); + std::vector<SPItem *> items(_selection->items().begin(), _selection->items().end()); SnapManager &m = _desktop->namedview->snap_manager; m.setup(_desktop); m.setRotationCenterSource(items); |
