diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-03-21 21:24:37 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-03-21 21:24:37 +0000 |
| commit | c1487f9dc277520b8734b7e80387b35c78d979ae (patch) | |
| tree | b0a57903db1e8f37258a65e1db40317b28445d33 /src/live_effects | |
| parent | update to trunk (diff) | |
| download | inkscape-c1487f9dc277520b8734b7e80387b35c78d979ae.tar.gz inkscape-c1487f9dc277520b8734b7e80387b35c78d979ae.zip | |
Fixed bug whith maps
(bzr r13645.1.49)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/lpe-bspline.cpp | 44 | ||||
| -rw-r--r-- | src/live_effects/lpe-bspline.h | 3 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 46 |
3 files changed, 29 insertions, 64 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp index b924d8a23..dba501f42 100644 --- a/src/live_effects/lpe-bspline.cpp +++ b/src/live_effects/lpe-bspline.cpp @@ -1,48 +1,16 @@ /* * Released under GNU GPL, read the file 'COPYING' for more information */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - #include <gtkmm.h> - -#if WITH_GLIBMM_2_32 -# include <glibmm/threads.h> -#endif - -#include <glib.h> -#include <glibmm/i18n.h> - - -#include "display/curve.h" -#include <2geom/bezier-curve.h> -#include <2geom/point.h> -#include "helper/geom-curves.h" #include "live_effects/lpe-bspline.h" -#include "live_effects/lpeobject.h" -#include "live_effects/parameter/parameter.h" #include "ui/widget/scalar.h" -#include "xml/repr.h" -#include "svg/svg.h" +#include "display/curve.h" +#include "helper/geom-curves.h" #include "sp-path.h" -#include "style.h" -#include "document-private.h" -#include "document.h" -#include "document-undo.h" -#include "verbs.h" -#include "sp-lpe-item.h" -#include "sp-namedview.h" -#include "display/sp-canvas.h" -#include <typeinfo> -#include <vector> -#include "util/units.h" -// For handling un-continuous paths: -#include "message-stack.h" -#include "inkscape.h" - -using Inkscape::DocumentUndo; +#include "svg/svg.h" +#include "xml/repr.h" +// TODO due to internal breakage in glibmm headers, this must be last: +#include <glibmm/i18n.h> namespace Inkscape { namespace LivePathEffect { diff --git a/src/live_effects/lpe-bspline.h b/src/live_effects/lpe-bspline.h index 642562b24..8017e39ef 100644 --- a/src/live_effects/lpe-bspline.h +++ b/src/live_effects/lpe-bspline.h @@ -6,9 +6,8 @@ * * Released under GNU GPL, read the file 'COPYING' for more information */ - #include "live_effects/effect.h" -#include "live_effects/parameter/bool.h" + #include <vector> namespace Inkscape { diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 09436676c..93c21469a 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -149,8 +149,7 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem) satellites.push_back(std::make_pair(counterTotal-1, satellite)); } } - pointwise = new Pointwise( pwd2_in); - pointwise->setSatellites(satellites); + pointwise = new Pointwise( pwd2_in,satellites); satellitepairarrayparam_values.set_pointwise(pointwise); } else { g_warning("LPE Fillet/Chamfer can only be applied to shapes (not groups)."); @@ -373,8 +372,11 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) Piecewise<D2<SBasis> > pwd2_in = paths_to_pw(original_pathv); pwd2_in = remove_short_cuts(pwd2_in, 0.01); std::vector<std::pair<unsigned int,Geom::Satellite> > sats; - sats = satellitepairarrayparam_values.data(); - + if(!pointwise){ + sats = satellitepairarrayparam_values.data(); + } else { + sats = pointwise->getSatellites(); + } //optional call if(hide_knots){ satellitepairarrayparam_values.set_helper_size(0); @@ -382,30 +384,29 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) satellitepairarrayparam_values.set_helper_size(helper_size); } bool refresh = false; - for (std::vector<std::pair<unsigned int,Geom::Satellite> >::iterator it = sats.begin(); it != sats.end(); ++it) { - if(it->second.getIsTime() != flexible){ - it->second.setIsTime(flexible); - double amount = it->second.getAmount(); - D2<SBasis> d2_in = pwd2_in[it->first]; - if(it->second.getIsTime()){ - double time = it->second.toTime(amount,d2_in); - it->second.setAmount(time); + for(unsigned i = 0; i < sats.size(); i++){ + if(sats[i].second.getIsTime() != flexible){ + sats[i].second.setIsTime(flexible); + double amount = sats[i].second.getAmount(); + D2<SBasis> d2_in = pwd2_in[sats[i].first]; + if(sats[i].second.getIsTime()){ + double time = sats[i].second.toTime(amount,d2_in); + sats[i].second.setAmount(time); } else { - double size = it->second.toSize(amount,d2_in); - it->second.setAmount(size); + double size = sats[i].second.toSize(amount,d2_in); + sats[i].second.setAmount(size); } } - if(it->second.getHasMirror() != mirror_knots){ - it->second.setHasMirror(mirror_knots); + if(sats[i].second.getHasMirror() != mirror_knots){ + sats[i].second.setHasMirror(mirror_knots); refresh = true; } - if(it->second.getHidden() != hide_knots){ - it->second.setHidden(hide_knots); + if(sats[i].second.getHidden() != hide_knots){ + sats[i].second.setHidden(hide_knots); refresh = true; } } - pointwise = new Pointwise(pwd2_in); - pointwise->setSatellites(sats); + pointwise = new Pointwise(pwd2_in, sats); //mandatory call satellitepairarrayparam_values.set_pointwise(pointwise); if(refresh){ @@ -421,10 +422,7 @@ LPEFilletChamfer::adjustForNewPath(std::vector<Geom::Path> const &path_in) { if (!path_in.empty() && pointwise) { pointwise->recalculate_for_new_pwd2(paths_to_pw(pathv_to_linear_and_cubic_beziers(path_in))); - std::vector<std::pair<unsigned int,Geom::Satellite> > sats = pointwise->getSatellites(); - pointwise->set_extremes(sats,false,true,0.0,0.0); - pointwise->setSatellites(sats); - satellitepairarrayparam_values.set_pointwise(pointwise); + pointwise->set_extremes(false,true,0.0,0.0); } } |
