summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-01-02 14:42:39 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-01-02 14:42:39 +0000
commit55e228f842373d4ec4dd1c8ecffb4aa55cb73575 (patch)
treefe6d7a6f87817409d8a8b66e8ae50be6f92236a0 /src
parentupdate to latest 2geom (diff)
downloadinkscape-55e228f842373d4ec4dd1c8ecffb4aa55cb73575.tar.gz
inkscape-55e228f842373d4ec4dd1c8ecffb4aa55cb73575.zip
Fix LP bug #179328
(bzr r4365)
Diffstat (limited to 'src')
-rw-r--r--src/path-chemistry.cpp14
-rw-r--r--src/sp-path.cpp14
-rw-r--r--src/sp-path.h1
3 files changed, 25 insertions, 4 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index b09d63ec0..744d5ede8 100644
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
@@ -388,6 +388,8 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/)
return repr;
}
+
+// FIXME: THIS DOES NOT REVERSE THE NODETYPES ORDER!
void
sp_selected_path_reverse()
{
@@ -410,16 +412,20 @@ sp_selected_path_reverse()
for (GSList *i = items; i != NULL; i = i->next) {
- if (!SP_IS_SHAPE(i->data))
+ if (!SP_IS_PATH(i->data))
continue;
did = true;
- SPShape *shape = SP_SHAPE(i->data);
+ SPPath *path = SP_PATH(i->data);
- SPCurve *rcurve = sp_curve_reverse(shape->curve);
+ SPCurve *rcurve = sp_curve_reverse(sp_path_get_curve_reference(path));
gchar *str = sp_svg_write_path(SP_CURVE_BPATH(rcurve));
- SP_OBJECT_REPR(shape)->setAttribute("d", str);
+ if ( sp_shape_has_path_effect(SP_SHAPE(path)) ) {
+ SP_OBJECT_REPR(path)->setAttribute("inkscape:original-d", str);
+ } else {
+ SP_OBJECT_REPR(path)->setAttribute("d", str);
+ }
g_free(str);
sp_curve_unref(rcurve);
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 8aed67590..b9e94d72e 100644
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
@@ -452,6 +452,20 @@ sp_path_get_curve_for_edit (SPPath *path)
}
}
+/**
+ * Return a reference to original_curve if it exists or
+ * shape->curve if not.
+ */
+const SPCurve*
+sp_path_get_curve_reference (SPPath *path)
+{
+ if (path->original_curve) {
+ return path->original_curve;
+ } else {
+ return path->curve;
+ }
+}
+
/*
Local Variables:
mode:c++
diff --git a/src/sp-path.h b/src/sp-path.h
index cd413db54..bf294c37c 100644
--- a/src/sp-path.h
+++ b/src/sp-path.h
@@ -37,6 +37,7 @@ gint sp_nodes_in_path(SPPath *path);
void sp_path_set_original_curve (SPPath *path, SPCurve *curve, unsigned int owner, bool write);
SPCurve* sp_path_get_original_curve (SPPath *path);
SPCurve* sp_path_get_curve_for_edit (SPPath *path);
+const SPCurve* sp_path_get_curve_reference (SPPath *path);
#endif