summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74f64c6)
raw | patch | inline | side by side (parent: 74f64c6)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 14 Apr 2008 07:36:34 +0000 (07:36 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 14 Apr 2008 07:36:34 +0000 (07:36 +0000) |
src/live_effects/lpe-bendpath.cpp | patch | blob | history | |
src/nodepath.cpp | patch | blob | history |
index 8ce3ce7888fdb02a2432fb77f3ce145d933639b3..49569d4b52d854ceb5a00566478f25e23b3e08a7 100644 (file)
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);
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);
// 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))
{
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 faade79a644b4948a108e8b778e54418106ba1f3..a9886046c67c4ea7ab22f6781b3042ad6783f840 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
}
}
-/* 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"
}