summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/splivarot.cpp17
-rw-r--r--src/splivarot.h1
2 files changed, 12 insertions, 6 deletions
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 58adee3a2..a23d6da02 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -1723,6 +1723,17 @@ Path_for_item(SPItem *item, bool doTransformation, bool transformFull)
bpath=SP_CURVE_BPATH(curve);
}
+ Path *dest = bpath_to_Path(bpath);
+
+ if ( doTransformation ) {
+ if ( bpath ) g_free(bpath);
+ } else {
+ sp_curve_unref(curve);
+ }
+ return dest;
+}
+
+Path *bpath_to_Path(NArtBpath const *bpath) {
Path *dest = new Path;
dest->SetBackData(false);
{
@@ -1776,12 +1787,6 @@ Path_for_item(SPItem *item, bool doTransformation, bool transformFull)
if (closed)
dest->Close();
}
-
- if ( doTransformation ) {
- if ( bpath ) g_free(bpath);
- } else {
- sp_curve_unref(curve);
- }
return dest;
}
diff --git a/src/splivarot.h b/src/splivarot.h
index 4e73eac9f..cf1ebcd94 100644
--- a/src/splivarot.h
+++ b/src/splivarot.h
@@ -44,6 +44,7 @@ void sp_selected_path_simplify ();
Path *Path_for_item(SPItem *item, bool doTransformation, bool transformFull = true);
NR::Maybe<Path::cut_position> get_nearest_position_on_Path(Path *path, NR::Point p);
NR::Point get_point_on_Path(Path *path, int piece, double t);
+Path *bpath_to_Path(NArtBpath const *bpath);
#endif