summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/measure-tool.cpp
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2019-08-18 15:29:16 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-08-18 15:29:16 +0000
commit3ffefe1e05e3858ce6584dc644817c411232dc77 (patch)
treee992648f9c1598efe6c810009213dbf9b7b31ff4 /src/ui/tools/measure-tool.cpp
parentFormatting last commit (diff)
downloadinkscape-3ffefe1e05e3858ce6584dc644817c411232dc77.tar.gz
inkscape-3ffefe1e05e3858ce6584dc644817c411232dc77.zip
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
Diffstat (limited to 'src/ui/tools/measure-tool.cpp')
-rw-r--r--src/ui/tools/measure-tool.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp
index 6633cdd64..568d8c542 100644
--- a/src/ui/tools/measure-tool.cpp
+++ b/src/ui/tools/measure-tool.cpp
@@ -1260,8 +1260,10 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom,
dimension_offset = 70;
Geom::PathVector lineseg;
Geom::Path p;
- p.start(desktop->dt2doc(start_p));
- p.appendNew<Geom::LineSegment>(desktop->dt2doc(end_p));
+ Geom::Point start_p_doc = start_p * desktop->dt2doc();
+ Geom::Point end_p_doc = end_p * desktop->dt2doc();
+ p.start(start_p_doc);
+ p.appendNew<Geom::LineSegment>(end_p_doc);
lineseg.push_back(p);
double angle = atan2(end_p - start_p);
@@ -1274,7 +1276,7 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom,
std::vector<SPItem*> items;
SPDocument *doc = desktop->getDocument();
- Geom::Rect rect(start_p, end_p);
+ Geom::Rect rect(start_p_doc, end_p_doc);
items = doc->getItemsPartiallyInBox(desktop->dkey, rect, false, true, false, true);
Inkscape::LayerModel *layer_model = nullptr;
SPObject *current_layer = nullptr;