summaryrefslogtreecommitdiffstats
path: root/src/splivarot.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-04 23:36:25 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-04 23:36:25 +0000
commitbe2f7a2520b6aceca598afbaa16ed0b5971b48c0 (patch)
treec31cbb674aaa46cb589be00c7f0062aa09faffbd /src/splivarot.cpp
parent2geomify calculation of number of markers on a path (diff)
downloadinkscape-be2f7a2520b6aceca598afbaa16ed0b5971b48c0.tar.gz
inkscape-be2f7a2520b6aceca598afbaa16ed0b5971b48c0.zip
create pathvector_for_curve method.
(bzr r6160)
Diffstat (limited to 'src/splivarot.cpp')
-rw-r--r--src/splivarot.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 944c15f84..88daaa666 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -48,7 +48,7 @@
#include "libnr/nr-path.h"
#include "xml/repr.h"
#include "xml/repr-sorting.h"
-
+#include <2geom/pathvector.h>
#include <libnr/nr-matrix-fns.h>
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-matrix-translate-ops.h>
@@ -1764,6 +1764,27 @@ bpath_for_curve(SPItem *item, SPCurve *curve, bool doTransformation, bool transf
return new_bpath;
}
+/*
+ * NOTE: Returns empty pathvector if curve == NULL
+ * TODO: see if calling this method can be optimized. All the pathvector copying might be slow.
+ */
+Geom::PathVector
+pathvector_for_curve(SPItem *item, SPCurve *curve, bool doTransformation, bool transformFull)
+{
+ if (curve == NULL)
+ return Geom::PathVector();
+
+ if (doTransformation) {
+ if (transformFull) {
+ return (curve->get_pathvector()) * sp_item_i2doc_affine(item);
+ } else {
+ return (curve->get_pathvector()) * to_2geom(item->transform);
+ }
+ } else {
+ return curve->get_pathvector();
+ }
+}
+
SPCurve* curve_for_item(SPItem *item)
{
if (!item)