summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-02-15 23:12:00 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-02-15 23:12:00 +0000
commit5c3350ef1281298f25c1cbcb60a66d238a417030 (patch)
tree2d5d1ae0b310f4b8a58c6710ea5fd10cd3171458 /src
parentupdate to trunk (diff)
downloadinkscape-5c3350ef1281298f25c1cbcb60a66d238a417030.tar.gz
inkscape-5c3350ef1281298f25c1cbcb60a66d238a417030.zip
added knots
(bzr r13645.1.12)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp20
-rw-r--r--src/live_effects/parameter/array.cpp2
-rw-r--r--src/live_effects/parameter/array.h14
-rw-r--r--src/live_effects/parameter/satellitepairarray.cpp2
4 files changed, 20 insertions, 18 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index 884e51ffd..5d6358bb2 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -54,11 +54,10 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem)
Geom::Piecewise<Geom::D2<Geom::SBasis> > n = rot90(unitVector(der));
satellitepairarrayparam_values.set_pwd2(pwd2_in, n);
for (Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) {
- if (path_it->empty())
+ if (path_it->empty()){
continue;
-
+ }
Geom::Path::const_iterator curve_it1 = path_it->begin();
- Geom::Path::const_iterator curve_it2 = ++(path_it->begin());
Geom::Path::const_iterator curve_endit = path_it->end_default();
if (path_it->closed()) {
const Geom::Curve &closingline = path_it->back_closed();
@@ -72,22 +71,25 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem)
curve_endit = path_it->end_open();
}
}
+ Geom::Path::const_iterator curve_end = curve_endit;
+ --curve_end;
int counter = 0;
while (curve_it1 != curve_endit) {
Geom::Satellite satellite(Geom::FILLET, true, true, false, false, 0.0, 0.2);
Geom::NodeType nodetype;
- if(counter!=0){
- nodetype = get_nodetype((*path_it)[counter - 1], *curve_it1);
+ if (counter==0) {
+ if (path_it->closed()) {
+ nodetype = Geom::get_nodetype(*curve_end, *curve_it1);
+ } else {
+ nodetype = Geom::NODE_NONE;
+ }
} else {
- nodetype = Geom::NODE_NONE;
+ nodetype = get_nodetype((*path_it)[counter - 1], *curve_it1);
}
if (nodetype == Geom::NODE_CUSP) {
satellites.push_back(std::make_pair(counter, satellite));
}
++curve_it1;
- if (curve_it2 != curve_endit) {
- ++curve_it2;
- }
counter++;
}
}
diff --git a/src/live_effects/parameter/array.cpp b/src/live_effects/parameter/array.cpp
index d17f28c4f..d1d718b08 100644
--- a/src/live_effects/parameter/array.cpp
+++ b/src/live_effects/parameter/array.cpp
@@ -53,7 +53,7 @@ sp_svg_satellite_read_d(gchar const *str, Geom::Satellite *sat){
if (!str) {
return 0;
}
- gchar ** strarray = g_strsplit(str, " * ", 0);
+ gchar ** strarray = g_strsplit(str, "*", 0);
if(strarray[6] && !strarray[7]){
std::map< gchar const *, Geom::SatelliteType> gts = sat->GcharMapToSatelliteType;
sat->setSatelliteType(gts[strarray[0]]);
diff --git a/src/live_effects/parameter/array.h b/src/live_effects/parameter/array.h
index 9f26ed3e6..ba1ed3d4e 100644
--- a/src/live_effects/parameter/array.h
+++ b/src/live_effects/parameter/array.h
@@ -114,20 +114,20 @@ protected:
void writesvgData(SVGOStringStream &str, std::pair<int, Geom::Satellite> const &nVector) const {
str << nVector.first;
- str << " , ";
+ str << ",";
std::map<Geom::SatelliteType, gchar const *> stg = nVector.second.SatelliteTypeToGcharMap;
str << stg[nVector.second.satellitetype()];
- str << " * ";
+ str << "*";
str << nVector.second.isTime();
- str << " * ";
+ str << "*";
str << nVector.second.active();
- str << " * ";
+ str << "*";
str << nVector.second.hasMirror();
- str << " * ";
+ str << "*";
str << nVector.second.hidden();
- str << " * ";
+ str << "*";
str << nVector.second.size();
- str << " * ";
+ str << "*";
str <<nVector.second.time();
}
diff --git a/src/live_effects/parameter/satellitepairarray.cpp b/src/live_effects/parameter/satellitepairarray.cpp
index f4f79b485..a40e70e1f 100644
--- a/src/live_effects/parameter/satellitepairarray.cpp
+++ b/src/live_effects/parameter/satellitepairarray.cpp
@@ -93,7 +93,7 @@ void SatellitePairArrayParamKnotHolderEntity::knot_set(Point const &p,
Geom::Point
SatellitePairArrayParamKnotHolderEntity::knot_get() const
{
- Geom::Point const canvas_point = _pparam->_vector.at(_index).second.getPosition(_pparam->last_pwd2[_pparam->_vector.at(_index).second]);
+ Geom::Point const canvas_point = _pparam->_vector.at(_index).second.getPosition(_pparam->last_pwd2[_pparam->_vector.at(_index).first]);
return canvas_point;
}