summaryrefslogtreecommitdiffstats
path: root/src/splivarot.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-04-01 03:04:55 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-04-01 03:04:55 +0000
commita9c4f968812f8dad06b694573d3ed67eb03dafcd (patch)
tree35bf1f3b2e580baf55ec36f2970e3cf1ccf14497 /src/splivarot.cpp
parentturns out, all these synthesize_events were not necessary at all - they just ... (diff)
downloadinkscape-a9c4f968812f8dad06b694573d3ed67eb03dafcd.tar.gz
inkscape-a9c4f968812f8dad06b694573d3ed67eb03dafcd.zip
switch get_nearest_position and get_point to using supplied livarot Path instead of creating one each time from an item
(bzr r384)
Diffstat (limited to 'src/splivarot.cpp')
-rw-r--r--src/splivarot.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index df5b82710..8dbdcdfd7 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -42,7 +42,8 @@
#include "livarot/Path.h"
#include "livarot/Shape.h"
-Path *Path_for_item(SPItem *item, bool doTransformation, bool transformFull = true);
+#include "splivarot.h"
+
bool Ancetre(Inkscape::XML::Node *a, Inkscape::XML::Node *who);
void sp_selected_path_boolop(bool_op bop);
@@ -1566,31 +1567,17 @@ Path_for_item(SPItem *item, bool doTransformation, bool transformFull)
return dest;
}
-NR::Maybe<Path::cut_position> get_nearest_position_on_Path(SPItem *item, NR::Point p)
+NR::Maybe<Path::cut_position> get_nearest_position_on_Path(Path *path, NR::Point p)
{
- //Create and initialize a livarot Path
- Path *path = Path_for_item(item, true, true);
- if (path == NULL) {
- return NR::Nothing();
- }
- path->ConvertWithBackData(0.01);
-
//get nearest position on path
Path::cut_position pos = path->PointToCurvilignPosition(p);
- delete path;
return pos;
}
-NR::Point get_point_on_Path(SPItem *item, int piece, double t)
+NR::Point get_point_on_Path(Path *path, int piece, double t)
{
- //Create and initialize a livarot Path
- Path *path = Path_for_item(item, true, true);
- path->ConvertWithBackData(0.01);
-
- //get nearest position on path
NR::Point p;
path->PointAt(piece, t, p);
- delete path;
return p;
}