From 3ffefe1e05e3858ce6584dc644817c411232dc77 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Sun, 18 Aug 2019 17:29:16 +0200 Subject: reduce usage of desktop coordinates (#341) - avoid unnecessary internal usage of desktop coordinates, e.g. in SpellCheck::compareTextBboxes - document whether a function argument is in document or desktop coordinates, e.g. for SPDocument::getItemsInBox --- src/ui/tools/node-tool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ui/tools/node-tool.cpp') diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index a14114cb7..63161b3cd 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -723,13 +723,17 @@ void NodeTool::update_tip(GdkEvent *event) { } } +/** + * @param sel Area in desktop coordinates + */ void NodeTool::select_area(Geom::Rect const &sel, GdkEventButton *event) { using namespace Inkscape::UI; if (this->_multipath->empty()) { // if multipath is empty, select rubberbanded items rather than nodes Inkscape::Selection *selection = this->desktop->selection; - std::vector items = this->desktop->getDocument()->getItemsInBox(this->desktop->dkey, sel); + auto sel_doc = desktop->dt2doc() * sel; + std::vector items = this->desktop->getDocument()->getItemsInBox(this->desktop->dkey, sel_doc); selection->setList(items); } else { if (!held_shift(*event)) { -- cgit v1.2.3