diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-02-01 11:33:03 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-02-01 11:33:03 +0000 |
| commit | 1e8014478b4185861ec348250a88d8476140b35f (patch) | |
| tree | c12590b487f46f28bd2059df5eeb0b4a34a78942 /src/ui/tools | |
| parent | add comment to bspline red outline hack (diff) | |
| download | inkscape-1e8014478b4185861ec348250a88d8476140b35f.tar.gz inkscape-1e8014478b4185861ec348250a88d8476140b35f.zip | |
Add correct preview for coninuing paths whith pencil and draw modes
(bzr r11950.1.245)
Diffstat (limited to 'src/ui/tools')
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index a48f8911a..8c13a0584 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -43,6 +43,10 @@ #include "tools-switch.h" #include "ui/control-manager.h" //spanish: incluimos los archivos necesarios para las BSpline y Spiro +#include "live_effects/effect.h" +#include "live_effects/lpeobject.h" +#include "live_effects/lpeobject-reference.h" +#include "live_effects/parameter/path.h" #define INKSCAPE_LPE_SPIRO_C #include "live_effects/lpe-spiro.h" @@ -68,6 +72,8 @@ #include "tool-factory.h" +#include "live_effects/effect.h" + using Inkscape::ControlManager; @@ -1467,6 +1473,32 @@ static void bspline_spiro_off(PenTool *const pc) static void bspline_spiro_start_anchor(PenTool *const pc, bool shift) { + LivePathEffect::LPEBSpline *lpe_bsp = NULL; + + if (SP_IS_LPE_ITEM(pc->white_item) && SP_LPE_ITEM(pc->white_item)->hasPathEffect()){ + Inkscape::LivePathEffect::Effect* thisEffect = SP_LPE_ITEM(pc->white_item)->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE); + if(thisEffect){ + lpe_bsp = dynamic_cast<LivePathEffect::LPEBSpline*>(thisEffect->getLPEObj()->get_lpe()); + } + } + if(lpe_bsp){ + pc->bspline = true; + }else{ + pc->bspline = false; + } + LivePathEffect::LPESpiro *lpe_spi = NULL; + + if (SP_IS_LPE_ITEM(pc->white_item) && SP_LPE_ITEM(pc->white_item)->hasPathEffect()){ + Inkscape::LivePathEffect::Effect* thisEffect = SP_LPE_ITEM(pc->white_item)->getPathEffectOfType(Inkscape::LivePathEffect::SPIRO); + if(thisEffect){ + lpe_spi = dynamic_cast<LivePathEffect::LPESpiro*>(thisEffect->getLPEObj()->get_lpe()); + } + } + if(lpe_spi){ + pc->spiro = true; + }else{ + pc->spiro = false; + } if(!pc->spiro && !pc->bspline) return; |
