summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-04-14 07:36:34 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-04-14 07:36:34 +0000
commitc4bf8cf15f8a51ab58b358ae84a3c761090503f5 (patch)
treed5595266d453bb65360da4bb6951cc0da312fd69 /src
parentfix 216898 (diff)
downloadinkscape-c4bf8cf15f8a51ab58b358ae84a3c761090503f5.tar.gz
inkscape-c4bf8cf15f8a51ab58b358ae84a3c761090503f5.zip
whitespace + comment
(bzr r5437)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-bendpath.cpp38
-rw-r--r--src/nodepath.cpp8
2 files changed, 24 insertions, 22 deletions
diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp
index 8ce3ce788..49569d4b5 100644
--- a/src/live_effects/lpe-bendpath.cpp
+++ b/src/live_effects/lpe-bendpath.cpp
@@ -88,7 +88,7 @@ LPEBendPath::doBeforeEffect (SPLPEItem *lpeitem)
using namespace Geom;
Piecewise<D2<SBasis> > pwd2;
- std::vector<Geom::Path> temppath;
+ std::vector<Geom::Path> temppath;
recursive_original_bbox(SP_GROUP(lpeitem), pwd2, temppath);
@@ -99,7 +99,7 @@ LPEBendPath::doBeforeEffect (SPLPEItem *lpeitem)
D2<Piecewise<SBasis> > d2pw = make_cuts_independant(pwd2);
boundingbox_X = bounds_exact(d2pw[0]);
boundingbox_Y = bounds_exact(d2pw[1]);
- }
+ }
}
@@ -119,7 +119,7 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd
Piecewise<SBasis> x = vertical_pattern.get_value() ? Piecewise<SBasis>(patternd2[1]) : Piecewise<SBasis>(patternd2[0]);
Piecewise<SBasis> y = vertical_pattern.get_value() ? Piecewise<SBasis>(patternd2[0]) : Piecewise<SBasis>(patternd2[1]);
-//We use the group bounding box size or the path bbox size to translate well x and y
+//We use the group bounding box size or the path bbox size to translate well x and y
if(groupSpecialBehavior == false)
{
boundingbox_X = bounds_exact(x);
@@ -153,7 +153,7 @@ LPEBendPath::resetDefaults(SPItem * item)
// set the bend path to run horizontally in the middle of the bounding box of the original path
using namespace Geom;
Piecewise<D2<SBasis> > pwd2;
- std::vector<Geom::Path> temppath;
+ std::vector<Geom::Path> temppath;
if (SP_IS_PATH(item))
{
@@ -165,27 +165,25 @@ LPEBendPath::resetDefaults(SPItem * item)
recursive_original_bbox(SP_GROUP(item), pwd2, temppath);
}
- for (unsigned int i=0; i < temppath.size(); i++) {
- pwd2.concat( temppath[i].toPwSb() );
+ for (unsigned int i=0; i < temppath.size(); i++) {
+ pwd2.concat( temppath[i].toPwSb() );
}
- D2<Piecewise<SBasis> > d2pw = make_cuts_independant(pwd2);
- boundingbox_X = bounds_exact(d2pw[0]);
- boundingbox_Y = bounds_exact(d2pw[1]);
-
-
- Point start(boundingbox_X.min(), (boundingbox_Y.max()+boundingbox_Y.min())/2);
- Point end(boundingbox_X.max(), (boundingbox_Y.max()+boundingbox_Y.min())/2);
+ D2<Piecewise<SBasis> > d2pw = make_cuts_independant(pwd2);
+ boundingbox_X = bounds_exact(d2pw[0]);
+ boundingbox_Y = bounds_exact(d2pw[1]);
- if ( Geom::are_near(start,end) ) {
- end += Point(1.,0.);
- }
- Geom::Path path;
- path.start( start );
- path.appendNew<Geom::LineSegment>( end );
- bend_path.param_set_and_write_new_value( path.toPwSb() );
+ Point start(boundingbox_X.min(), (boundingbox_Y.max()+boundingbox_Y.min())/2);
+ Point end(boundingbox_X.max(), (boundingbox_Y.max()+boundingbox_Y.min())/2);
+ if ( Geom::are_near(start,end) ) {
+ end += Point(1.,0.);
+ }
+ Geom::Path path;
+ path.start( start );
+ path.appendNew<Geom::LineSegment>( end );
+ bend_path.param_set_and_write_new_value( path.toPwSb() );
}
}
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index faade79a6..a9886046c 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -4738,13 +4738,17 @@ void sp_nodepath_show_helperpath(Inkscape::NodePath::Path *np, bool show) {
}
}
-/* this function does not work yet */
+/* sp_nodepath_make_straight_path:
+ * Prevents user from curving the path by dragging a segment or activating handles etc.
+ * The resulting path is a linear interpolation between nodal points, with only straight segments.
+ * !!! this function does not work completely yet: it does not actively straighten the path, only prevents the path from being curved
+ */
void sp_nodepath_make_straight_path(Inkscape::NodePath::Path *np) {
np->straight_path = true;
np->show_handles = false;
g_message("add code to make the path straight.");
// do sp_nodepath_convert_node_type on all nodes?
- // search for this text !!! "Make selected segments lines"
+ // coding tip: search for this text : "Make selected segments lines"
}