diff options
Diffstat (limited to 'src/splivarot.cpp')
| -rw-r--r-- | src/splivarot.cpp | 23 |
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) |
