diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-03-03 15:16:30 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-03-03 15:16:30 +0000 |
| commit | 8f670aecc6764c0796c89cb4615626d66d4aa849 (patch) | |
| tree | 888cb60349377d62533d0508366aec73ba79b387 /src/live_effects | |
| parent | Fix a bug with 0 width shapes (diff) | |
| parent | Fix bug: 1552003 Randomize color extension has no limits (diff) | |
| download | inkscape-8f670aecc6764c0796c89cb4615626d66d4aa849.tar.gz inkscape-8f670aecc6764c0796c89cb4615626d66d4aa849.zip | |
update to trunk
(bzr r14648.1.5)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/effect.cpp | 3 | ||||
| -rw-r--r-- | src/live_effects/effect.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-bendpath.cpp | 5 | ||||
| -rw-r--r-- | src/live_effects/lpe-copy_rotate.cpp | 5 | ||||
| -rw-r--r-- | src/live_effects/lpe-envelope.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-lattice.cpp | 5 | ||||
| -rw-r--r-- | src/live_effects/lpe-lattice2.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.cpp | 10 | ||||
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-offset.cpp | 10 | ||||
| -rw-r--r-- | src/live_effects/lpe-offset.h | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-perspective-envelope.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-perspective_path.cpp | 3 | ||||
| -rw-r--r-- | src/live_effects/lpe-roughen.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-simplify.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-transform_2pts.cpp | 3 | ||||
| -rw-r--r-- | src/live_effects/lpe-vonkoch.cpp | 5 |
17 files changed, 17 insertions, 58 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index fe7bf3a97..47fd02554 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -356,7 +356,8 @@ Effect::createAndApply(EffectType type, SPDocument *doc, SPItem *item) } Effect::Effect(LivePathEffectObject *lpeobject) - : _provides_knotholder_entities(false), + : apply_to_clippath_and_mask(false), + _provides_knotholder_entities(false), oncanvasedit_it(0), is_visible(_("Is visible?"), _("If unchecked, the effect remains applied to the object but is temporarily disabled on canvas"), "is_visible", &wr, this, true), show_orig_path(false), diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index ea57ff243..898e089b7 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -121,6 +121,7 @@ public: inline bool isVisible() const { return is_visible; } void editNextParamOncanvas(SPItem * item, SPDesktop * desktop); + bool apply_to_clippath_and_mask; protected: Effect(LivePathEffectObject *lpeobject); @@ -144,6 +145,7 @@ protected: std::vector<Parameter *> param_vector; bool _provides_knotholder_entities; + int oncanvasedit_it; BoolParam is_visible; diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index d7c0b69a4..bc112285f 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -81,6 +81,7 @@ LPEBendPath::LPEBendPath(LivePathEffectObject *lpeobject) : prop_scale.param_set_increments(0.01, 0.10); _provides_knotholder_entities = true; + apply_to_clippath_and_mask = true; concatenate_before_pwd2 = true; } @@ -95,10 +96,6 @@ LPEBendPath::doBeforeEffect (SPLPEItem const* lpeitem) // get the item bounding box original_bbox(lpeitem); original_height = boundingbox_Y.max() - boundingbox_Y.min(); - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - - item->apply_to_clippath(item); - item->apply_to_mask(item); } Geom::Piecewise<Geom::D2<Geom::SBasis> > diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index 87d8f05a9..8dfaf7525 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -61,6 +61,7 @@ LPECopyRotate::LPECopyRotate(LivePathEffectObject *lpeobject) : { show_orig_path = true; _provides_knotholder_entities = true; + apply_to_clippath_and_mask = true; // register all your parameters here, so Inkscape knows which parameters this effect has: registerParameter(&copiesTo360); @@ -111,10 +112,6 @@ LPECopyRotate::doBeforeEffect (SPLPEItem const* lpeitem) if(copiesTo360 ){ rot_pos = origin; } - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); - } diff --git a/src/live_effects/lpe-envelope.cpp b/src/live_effects/lpe-envelope.cpp index 05a672ae8..e873c0b15 100644 --- a/src/live_effects/lpe-envelope.cpp +++ b/src/live_effects/lpe-envelope.cpp @@ -42,6 +42,7 @@ LPEEnvelope::LPEEnvelope(LivePathEffectObject *lpeobject) : registerParameter( dynamic_cast<Parameter *>(&bend_path3) ); registerParameter( dynamic_cast<Parameter *>(&bend_path4) ); concatenate_before_pwd2 = true; + apply_to_clippath_and_mask = true; } LPEEnvelope::~LPEEnvelope() @@ -54,9 +55,6 @@ LPEEnvelope::doBeforeEffect (SPLPEItem const* lpeitem) { // get the item bounding box original_bbox(lpeitem); - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); } Geom::Piecewise<Geom::D2<Geom::SBasis> > diff --git a/src/live_effects/lpe-lattice.cpp b/src/live_effects/lpe-lattice.cpp index c05bae7e1..3c23e349e 100644 --- a/src/live_effects/lpe-lattice.cpp +++ b/src/live_effects/lpe-lattice.cpp @@ -78,7 +78,7 @@ LPELattice::LPELattice(LivePathEffectObject *lpeobject) : registerParameter( dynamic_cast<Parameter *>(&grid_point14) ); registerParameter( dynamic_cast<Parameter *>(&grid_point15) ); - + apply_to_clippath_and_mask = true; } LPELattice::~LPELattice() @@ -176,9 +176,6 @@ void LPELattice::doBeforeEffect (SPLPEItem const* lpeitem) { original_bbox(lpeitem); - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); } void diff --git a/src/live_effects/lpe-lattice2.cpp b/src/live_effects/lpe-lattice2.cpp index b749370fa..0c403daec 100644 --- a/src/live_effects/lpe-lattice2.cpp +++ b/src/live_effects/lpe-lattice2.cpp @@ -103,6 +103,7 @@ LPELattice2::LPELattice2(LivePathEffectObject *lpeobject) : registerParameter(&grid_point_28x30); registerParameter(&grid_point_29x31); registerParameter(&grid_point_32x33x34x35); + apply_to_clippath_and_mask = true; } LPELattice2::~LPELattice2() @@ -358,9 +359,6 @@ LPELattice2::doBeforeEffect (SPLPEItem const* lpeitem) horizontal(grid_point_17, grid_point_19,horiz); horizontal(grid_point_20x21, grid_point_22x23,horiz); } - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); } void diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index 783053df2..c13cffb6a 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -33,7 +33,7 @@ LPEMirrorSymmetry::LPEMirrorSymmetry(LivePathEffectObject *lpeobject) : reflection_line(_("Reflection line:"), _("Line which serves as 'mirror' for the reflection"), "reflection_line", &wr, this, "M0,0 L100,100") { show_orig_path = true; - + apply_to_clippath_and_mask = true; registerParameter( dynamic_cast<Parameter *>(&discard_orig_path) ); registerParameter( dynamic_cast<Parameter *>(&reflection_line) ); } @@ -43,14 +43,6 @@ LPEMirrorSymmetry::~LPEMirrorSymmetry() } void -LPEMirrorSymmetry::doBeforeEffect (SPLPEItem const* lpeitem) -{ - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); -} - -void LPEMirrorSymmetry::doOnApply (SPLPEItem const* lpeitem) { using namespace Geom; diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h index 7a484a473..64a72d7b3 100644 --- a/src/live_effects/lpe-mirror_symmetry.h +++ b/src/live_effects/lpe-mirror_symmetry.h @@ -30,8 +30,6 @@ public: virtual void doOnApply (SPLPEItem const* lpeitem); - virtual void doBeforeEffect (SPLPEItem const* lpeitem); - virtual Geom::PathVector doEffect_path (Geom::PathVector const & path_in); private: diff --git a/src/live_effects/lpe-offset.cpp b/src/live_effects/lpe-offset.cpp index dd7af92a2..d611b88a1 100644 --- a/src/live_effects/lpe-offset.cpp +++ b/src/live_effects/lpe-offset.cpp @@ -31,7 +31,7 @@ LPEOffset::LPEOffset(LivePathEffectObject *lpeobject) : offset_pt(_("Offset"), _("Handle to control the distance of the offset from the curve"), "offset_pt", &wr, this) { show_orig_path = true; - + apply_to_clippath_and_mask = true; registerParameter(dynamic_cast<Parameter *>(&offset_pt)); } @@ -57,14 +57,6 @@ static void append_half_circle(Geom::Piecewise<Geom::D2<Geom::SBasis> > &pwd2, pwd2.continuousConcat(cap_pwd2); } -void -LPEOffset::doBeforeEffect (SPLPEItem const* lpeitem) -{ - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); -} - Geom::Piecewise<Geom::D2<Geom::SBasis> > LPEOffset::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in) { diff --git a/src/live_effects/lpe-offset.h b/src/live_effects/lpe-offset.h index 997311c7d..9966fd45d 100644 --- a/src/live_effects/lpe-offset.h +++ b/src/live_effects/lpe-offset.h @@ -28,8 +28,6 @@ public: virtual void doOnApply (SPLPEItem const* lpeitem); - virtual void doBeforeEffect (SPLPEItem const* lpeitem); - virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in); private: diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index 72c1b0e99..5b29df4a7 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -56,6 +56,7 @@ LPEPerspectiveEnvelope::LPEPerspectiveEnvelope(LivePathEffectObject *lpeobject) registerParameter(&up_right_point); registerParameter(&down_left_point); registerParameter(&down_right_point); + apply_to_clippath_and_mask = true; } LPEPerspectiveEnvelope::~LPEPerspectiveEnvelope() @@ -371,9 +372,6 @@ LPEPerspectiveEnvelope::doBeforeEffect (SPLPEItem const* lpeitem) horizontal(up_left_point, down_left_point,horiz); horizontal(up_right_point, down_right_point,horiz); } - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); setDefaults(); } diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp index 901519b4f..c8cdd7912 100644 --- a/src/live_effects/lpe-perspective_path.cpp +++ b/src/live_effects/lpe-perspective_path.cpp @@ -64,6 +64,7 @@ LPEPerspectivePath::LPEPerspectivePath(LivePathEffectObject *lpeobject) : concatenate_before_pwd2 = true; // don't split the path into its subpaths _provides_knotholder_entities = true; + apply_to_clippath_and_mask = true; } LPEPerspectivePath::~LPEPerspectivePath() @@ -100,8 +101,6 @@ LPEPerspectivePath::doBeforeEffect (SPLPEItem const* lpeitem) Geom::Affine doc2d = Geom::Scale(1, -1) * Geom::Translate(0, item->document->getHeight().value("px")); pmat = pmat * doc2d; pmat.copy_tmat(tmat); - item->apply_to_clippath(item); - item->apply_to_mask(item); } void LPEPerspectivePath::refresh(Gtk::Entry* perspective) { diff --git a/src/live_effects/lpe-roughen.cpp b/src/live_effects/lpe-roughen.cpp index b4ee54f1a..105fe2fc4 100644 --- a/src/live_effects/lpe-roughen.cpp +++ b/src/live_effects/lpe-roughen.cpp @@ -87,6 +87,7 @@ LPERoughen::LPERoughen(LivePathEffectObject *lpeobject) segments.param_set_increments(1, 1); segments.param_set_digits(0); seed = 0; + apply_to_clippath_and_mask = true; } LPERoughen::~LPERoughen() {} @@ -102,9 +103,6 @@ void LPERoughen::doBeforeEffect(SPLPEItem const *lpeitem) displace_y.resetRandomizer(); global_randomize.resetRandomizer(); srand(1); - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); } Gtk::Widget *LPERoughen::newWidget() diff --git a/src/live_effects/lpe-simplify.cpp b/src/live_effects/lpe-simplify.cpp index 4b62c6c65..f807bdc8d 100644 --- a/src/live_effects/lpe-simplify.cpp +++ b/src/live_effects/lpe-simplify.cpp @@ -60,6 +60,7 @@ LPESimplify::LPESimplify(LivePathEffectObject *lpeobject) helper_size.param_set_digits(2); radius_helper_nodes = 6.0; + apply_to_clippath_and_mask = true; } LPESimplify::~LPESimplify() {} @@ -71,10 +72,7 @@ LPESimplify::doBeforeEffect (SPLPEItem const* lpeitem) hp.clear(); } bbox = SP_ITEM(lpeitem)->visualBounds(); - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); radius_helper_nodes = helper_size; - item->apply_to_clippath(item); - item->apply_to_mask(item); } Gtk::Widget * diff --git a/src/live_effects/lpe-transform_2pts.cpp b/src/live_effects/lpe-transform_2pts.cpp index dd1a29689..1cd59b7fa 100644 --- a/src/live_effects/lpe-transform_2pts.cpp +++ b/src/live_effects/lpe-transform_2pts.cpp @@ -78,6 +78,7 @@ LPETransform2Pts::LPETransform2Pts(LivePathEffectObject *lpeobject) : strech.param_set_range(0, 999.0); strech.param_set_increments(0.01, 0.01); strech.param_set_digits(4); + apply_to_clippath_and_mask = true; } LPETransform2Pts::~LPETransform2Pts() @@ -167,8 +168,6 @@ LPETransform2Pts::doBeforeEffect (SPLPEItem const* lpeitem) previous_angle = transformed.angle(); previous_lenght = Geom::distance((Geom::Point)start, (Geom::Point)end); previous_start = start; - splpeitem->apply_to_clippath(splpeitem); - splpeitem->apply_to_mask(splpeitem); } void diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index 7b424e019..7eda7446e 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -64,7 +64,7 @@ LPEVonKoch::LPEVonKoch(LivePathEffectObject *lpeobject) : registerParameter( dynamic_cast<Parameter *>(&drawall) ); registerParameter( dynamic_cast<Parameter *>(&maxComplexity) ); //registerParameter( dynamic_cast<Parameter *>(&draw_boxes) ); - + apply_to_clippath_and_mask = true; nbgenerations.param_make_integer(); nbgenerations.param_set_range(0, Geom::infinity()); maxComplexity.param_make_integer(); @@ -262,9 +262,6 @@ LPEVonKoch::doBeforeEffect (SPLPEItem const* lpeitem) tmp_pathv.push_back(tmp_path); ref_path.set_new_value(tmp_pathv,true); } - SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem); - item->apply_to_clippath(item); - item->apply_to_mask(item); } |
