diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-01-02 18:10:43 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-01-02 18:10:43 +0000 |
| commit | 4517038755f4211da3b5e9afb5567e9d608875da (patch) | |
| tree | 6b8c8407c5e099d449cb206a7d9077221bd4cc2e /src/sp-item.cpp | |
| parent | add libnr <=> 2geom conversion helper headerfile (diff) | |
| download | inkscape-4517038755f4211da3b5e9afb5567e9d608875da.tar.gz inkscape-4517038755f4211da3b5e9afb5567e9d608875da.zip | |
+ Fix bug #179840, forking of LPEs
+ Groundwork for fixing transforming LPE bugs. TODO: implement the actual transformation of LPE parameters.
(bzr r4367)
Diffstat (limited to 'src/sp-item.cpp')
| -rw-r--r-- | src/sp-item.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp index f064b246c..90765fc94 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -58,12 +58,16 @@ #include "libnr/nr-matrix-translate-ops.h" #include "libnr/nr-scale-translate-ops.h" #include "libnr/nr-translate-scale-ops.h" +#include "libnr/nr-convert2geom.h" #include "algorithms/find-last-if.h" #include "util/reverse-list.h" #include "xml/repr.h" #include "extract-uri.h" +#include "live_effects/lpeobject.h" +#include "live_effects/effect.h" + #define noSP_ITEM_DEBUG_IDLE static void sp_item_class_init(SPItemClass *klass); @@ -1155,6 +1159,27 @@ sp_item_adjust_paint_recursive (SPItem *item, NR::Matrix advertized_transform, N } +void +sp_item_adjust_livepatheffect (SPItem *item, NR::Matrix const &postmul, bool set) +{ + if ( !SP_IS_SHAPE(item) ) + return; + + SPShape *shape = SP_SHAPE (item); + if ( sp_shape_has_path_effect(shape) ) { + LivePathEffectObject *lpeobj = sp_shape_get_livepatheffectobject(shape); + LivePathEffectObject *new_lpeobj = lpeobj->fork_private_if_necessary(); + if (new_lpeobj != lpeobj) { + sp_shape_set_path_effect(shape, new_lpeobj); + } + + Inkscape::LivePathEffect::Effect * effect = sp_shape_get_livepatheffect(shape); + if (effect) { + effect->transform_multiply (to_2geom(postmul), set); + } + } +} + /** * A temporary wrapper for the next function accepting the NRMatrix * instead of NR::Matrix |
