diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-07 00:16:38 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-07 00:23:18 +0000 |
| commit | c1dc7dd75c5f43b109d06444375dad58ff49872b (patch) | |
| tree | 9f32ebc24c681e63107971417c3ccb5684f2805d /src/ui/tools/freehand-base.cpp | |
| parent | Fix bug 1735316 - Pattern Along Path: Option to hide the new handler (diff) | |
| download | inkscape-c1dc7dd75c5f43b109d06444375dad58ff49872b.tar.gz inkscape-c1dc7dd75c5f43b109d06444375dad58ff49872b.zip | |
Fix bug 1733422 - Bezier and pencil tool don't work form: from clipboard
https://bugs.launchpad.net/inkscape/+bug/1733422
Also allow using all shapes in "from clipboard" pen/cil shapes drop down
Diffstat (limited to 'src/ui/tools/freehand-base.cpp')
| -rw-r--r-- | src/ui/tools/freehand-base.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 49b8436de..79c9ce7f9 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -36,6 +36,7 @@ #include "ui/tools/lpe-tool.h" #include "selection-chemistry.h" #include "sp-item-group.h" +#include "sp-rect.h" #include "live_effects/lpe-powerstroke.h" #include "style.h" #include "ui/control-manager.h" @@ -466,6 +467,8 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); if(cm->paste(SP_ACTIVE_DESKTOP,true)){ SPItem * pasted_clipboard = dc->selection->singleItem(); + dc->selection->toCurves(); + pasted_clipboard = dc->selection->singleItem(); if(pasted_clipboard){ Inkscape::XML::Node *pasted_clipboard_root = pasted_clipboard->getRepr(); Inkscape::XML::Node *path = sp_repr_lookup_name(pasted_clipboard_root, "svg:path", -1); // unlimited search depth @@ -494,6 +497,19 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, { gchar const *svgd = item->getRepr()->attribute("d"); if(bend_item && (SP_IS_SHAPE(bend_item) || SP_IS_GROUP(bend_item))){ + // If item is a SPRect, convert it to path first: + if ( dynamic_cast<SPRect *>(bend_item) ) { + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + if (desktop) { + Inkscape::Selection *sel = desktop->getSelection(); + if ( sel && !sel->isEmpty() ) { + sel->clear(); + sel->add(bend_item); + sel->toCurves(); + bend_item = sel->singleItem(); + } + } + } bend_item->moveTo(item,false); bend_item->transform.setTranslation(Geom::Point()); spdc_apply_bend_shape(svgd, dc, bend_item); |
