From e1d0c1cb00f84b66b38af6eec563cf60df7ba726 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 3 Oct 2016 18:08:29 +0200 Subject: Fix a bug on eraser mode when previous clip are shapes not paths (bzr r15145) --- src/ui/tools/eraser-tool.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/ui/tools/eraser-tool.cpp') diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 38c72cac0..12686160b 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -766,9 +766,17 @@ void EraserTool::set_to_accumulated() { if (bbox && bbox->intersects(*eraserBbox)) { SPClipPath *clip_path = item->clip_ref->getObject(); if (clip_path) { - SPPath *clip_data = SP_PATH(clip_path->firstChild()); + std::vector selected; + selected.push_back(SP_ITEM(clip_path->firstChild())); + std::vector to_select; + std::vector items(selected); + sp_item_list_to_curves(items, selected, to_select); + Inkscape::XML::Node * clip_data = SP_ITEM(clip_path->firstChild())->getRepr(); + if (!clip_data && !to_select.empty()) { + clip_data = *(to_select.begin()); + } if (clip_data) { - Inkscape::XML::Node *dup_clip = SP_OBJECT(clip_data)->getRepr()->duplicate(xml_doc); + 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)); if (dup_clip_obj) { -- cgit v1.2.3