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/ui/tools/tool-base.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/ui/tools/tool-base.cpp')
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index f85744744..8a35882b9 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -1051,9 +1051,8 @@ void sp_event_root_menu_popup(SPDesktop *desktop, SPItem *item, GdkEvent *event) item = sp_event_context_find_item (desktop, Geom::Point(event->button.x, event->button.y), FALSE, FALSE); - /* fixme: This is not what I want but works for now (Lauris) */ - if (event->type == GDK_KEY_PRESS) { - item = desktop->getSelection()->itemList().front(); + if (event->type == GDK_KEY_PRESS && !desktop->getSelection()->isEmpty()) { + item = desktop->getSelection()->items().front(); } ContextMenu* CM = new ContextMenu(desktop, item); @@ -1127,8 +1126,9 @@ SPItem *sp_event_context_find_item(SPDesktop *desktop, Geom::Point const &p, SPItem *item = 0; if (select_under) { - SPItem *selected_at_point = desktop->getItemFromListAtPointBottom( - desktop->selection->itemList(), p); + auto tmp = desktop->selection->items(); + std::vector<SPItem *> vec(tmp.begin(), tmp.end()); + SPItem *selected_at_point = desktop->getItemFromListAtPointBottom(vec, p); item = desktop->getItemAtPoint(p, into_groups, selected_at_point); if (item == NULL) { // we may have reached bottom, flip over to the top item = desktop->getItemAtPoint(p, into_groups, NULL); |
