diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-07-15 06:51:22 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-07-15 06:51:22 +0000 |
| commit | 0da345edc1f749a551af999f659411d0bf7de716 (patch) | |
| tree | 2467b5b7d183de401263e87c5ac7c7c1aaaa232c /src/ui/tools/eraser-tool.cpp | |
| parent | fix compiling issues and some improvements (diff) | |
| download | inkscape-0da345edc1f749a551af999f659411d0bf7de716.tar.gz inkscape-0da345edc1f749a551af999f659411d0bf7de716.zip | |
Eraser tool fixes
- Fix #331 Crash when erasing in document without layers
- Fix #332 Clip-path wrong when erasing with parent transform
Diffstat (limited to 'src/ui/tools/eraser-tool.cpp')
| -rw-r--r-- | src/ui/tools/eraser-tool.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 9e306dec7..3ea8a960e 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -651,7 +651,7 @@ void EraserTool::set_to_accumulated() { this->repr = repr; } - SPObject * top_layer = desktop->layer_manager->nthChildOf(desktop->layers->currentRoot(), 0); + SPObject * top_layer = desktop->currentRoot(); SPItem *item_repr = SP_ITEM(top_layer->appendChildRepr(this->repr)); Inkscape::GC::release(this->repr); item_repr->updateRepr(); @@ -781,8 +781,11 @@ void EraserTool::set_to_accumulated() { Inkscape::XML::Node *dup_clip = clip_data->duplicate(xml_doc); if (dup_clip) { SPItem * dup_clip_obj = SP_ITEM(item_repr->parent->appendChildRepr(dup_clip)); + Inkscape::GC::release(dup_clip); if (dup_clip_obj) { - dup_clip_obj->doWriteTransform(item->transform); + dup_clip_obj->transform *= + item->getRelativeTransform(SP_ITEM(item_repr->parent)); + dup_clip_obj->updateRepr(); clip_path->deleteObject(true); selection->raiseToTop(true); selection->add(dup_clip); |
