From 31e039aa8b8f69e4808dd022183f9a4826b87b5f Mon Sep 17 00:00:00 2001 From: johanengelen Date: Mon, 14 Apr 2008 07:36:34 +0000 Subject: [PATCH] whitespace + comment --- src/live_effects/lpe-bendpath.cpp | 38 +++++++++++++++---------------- src/nodepath.cpp | 8 +++++-- 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 > pwd2; - std::vector temppath; + std::vector temppath; recursive_original_bbox(SP_GROUP(lpeitem), pwd2, temppath); @@ -99,7 +99,7 @@ LPEBendPath::doBeforeEffect (SPLPEItem *lpeitem) D2 > 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 > const & pwd Piecewise x = vertical_pattern.get_value() ? Piecewise(patternd2[1]) : Piecewise(patternd2[0]); Piecewise y = vertical_pattern.get_value() ? Piecewise(patternd2[0]) : Piecewise(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 > pwd2; - std::vector temppath; + std::vector 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 > 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 > 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( 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( 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" } -- 2.30.2