diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-08-18 15:29:16 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-08-18 15:29:16 +0000 |
| commit | 3ffefe1e05e3858ce6584dc644817c411232dc77 (patch) | |
| tree | e992648f9c1598efe6c810009213dbf9b7b31ff4 /src/selection-chemistry.cpp | |
| parent | Formatting last commit (diff) | |
| download | inkscape-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 '')
| -rwxr-xr-x | src/selection-chemistry.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 39b70eb29..242319809 100755 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3611,7 +3611,7 @@ void ObjectSet::createBitmapCopy() // Get the bounding box of the selection doc->ensureUpToDate(); - Geom::OptRect bbox = visualBounds(); + Geom::OptRect bbox = documentBounds(SPItem::VISUAL_BBOX); if (!bbox) { if(desktop()) desktop()->clearWaitingCursor(); @@ -3727,9 +3727,8 @@ void ObjectSet::createBitmapCopy() } Geom::Affine t; - auto bbox_doc = (*bbox) * doc->dt2doc(); - double shift_x = bbox_doc.left(); - double shift_y = bbox_doc.top(); + double shift_x = bbox->left(); + double shift_y = bbox->top(); if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 96 dpi, snap it to pixel grid shift_x = round(shift_x); shift_y = round(shift_y); @@ -4247,7 +4246,7 @@ bool ObjectSet::fitCanvas(bool with_margins, bool skip_undo) desktop()->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to fit canvas to.")); return false; } - Geom::OptRect const bbox(visualBounds()); + Geom::OptRect const bbox = documentBounds(SPItem::VISUAL_BBOX); if (bbox) { document()->fitToRect(*bbox, with_margins); if(!skip_undo) @@ -4340,7 +4339,7 @@ fit_canvas_to_drawing(SPDocument *doc, bool with_margins) doc->ensureUpToDate(); SPItem const *const root = doc->getRoot(); - Geom::OptRect bbox = root->desktopVisualBounds(); + Geom::OptRect bbox = root->documentVisualBounds(); if (bbox) { doc->fitToRect(*bbox, with_margins); return true; |
