summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2007-02-25 06:03:32 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2007-02-25 06:03:32 +0000
commit339c16b51f00bb66e1b345b9cc08cc4431d3e755 (patch)
tree7a3a571d99b64528c0fd6780e0c08c81aba32025 /src
parentmove a global to a class property; reduce the use of is_scrolling to prevent ... (diff)
downloadinkscape-339c16b51f00bb66e1b345b9cc08cc4431d3e755.tar.gz
inkscape-339c16b51f00bb66e1b345b9cc08cc4431d3e755.zip
Factor out bpath_to_Path
(bzr r2431)
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