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/ui/tools/eraser-tool.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 'src/ui/tools/eraser-tool.cpp')
| -rw-r--r-- | src/ui/tools/eraser-tool.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 3ea8a960e..ed307acc5 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -670,7 +670,7 @@ void EraserTool::set_to_accumulated() { Inkscape::XML::Document *xml_doc = this->desktop->doc()->getReprDoc(); SPItem* acid = SP_ITEM(this->desktop->doc()->getObjectByRepr(this->repr)); - eraserBbox = acid->desktopVisualBounds(); + eraserBbox = acid->documentVisualBounds(); std::vector<SPItem*> remainingItems; std::vector<SPItem*> toWorkOn; if (selection->isEmpty()) { @@ -709,7 +709,7 @@ void EraserTool::set_to_accumulated() { } else if (SP_IS_GROUP(item) || use ) { /*Do nothing*/ } else { - Geom::OptRect bbox = item->desktopVisualBounds(); + Geom::OptRect bbox = item->documentVisualBounds(); if (bbox && bbox->intersects(*eraserBbox)) { Inkscape::XML::Node* dup = this->repr->duplicate(xml_doc); this->repr->parent()->appendChild(dup); @@ -758,7 +758,7 @@ void EraserTool::set_to_accumulated() { for (std::vector<SPItem*>::const_iterator i = toWorkOn.begin(); i != toWorkOn.end(); ++i){ selection->clear(); SPItem *item = *i; - Geom::OptRect bbox = item->desktopVisualBounds(); + Geom::OptRect bbox = item->documentVisualBounds(); Inkscape::XML::Document *xml_doc = this->desktop->doc()->getReprDoc(); Inkscape::XML::Node* dup = this->repr->duplicate(xml_doc); this->repr->parent()->appendChild(dup); @@ -800,7 +800,8 @@ void EraserTool::set_to_accumulated() { SPRect * rect = SP_RECT(item_repr->parent->appendChildRepr(rect_repr)); Inkscape::GC::release(rect_repr); rect->setPosition (bbox->left(), bbox->top(), bbox->width(), bbox->height()); - rect->transform = SP_ITEM(rect->parent)->i2dt_affine().inverse(); + rect->transform = SP_ITEM(rect->parent)->i2doc_affine().inverse(); + rect->updateRepr(); rect->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); selection->raiseToTop(true); |
