summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89a2f89)
raw | patch | inline | side by side (parent: 89a2f89)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 2 Jan 2008 14:42:39 +0000 (14:42 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 2 Jan 2008 14:42:39 +0000 (14:42 +0000) |
src/path-chemistry.cpp | patch | blob | history | |
src/sp-path.cpp | patch | blob | history | |
src/sp-path.h | patch | blob | history |
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index b09d63ec067661fbf3957dc8ecba64c9ebad7253..744d5ede80b46b9f2ed086cce01c1fbb4cb2005f 100644 (file)
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
return repr;
}
+
+// FIXME: THIS DOES NOT REVERSE THE NODETYPES ORDER!
void
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 8aed675900901ec04325d3d708a2e81b6a40058b..b9e94d72e3a6ffcfbc81cb9ce043eeaf29a9292a 100644 (file)
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
}
}
+/**
+ * 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 cd413db5447481140eee38553b1a7e1540206eaf..bf294c37ceebedf980d5af97eae31be309292e27 100644 (file)
--- a/src/sp-path.h
+++ b/src/sp-path.h
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