diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2015-07-04 15:25:59 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2015-07-04 15:25:59 +0000 |
| commit | 60437ac397d41678daba5daece227240e8ddd364 (patch) | |
| tree | 31f18c8296ffde9122492b46623375fc98585b17 /src/2geom/path.h | |
| parent | 2Geom CMake adjustment (diff) | |
| download | inkscape-60437ac397d41678daba5daece227240e8ddd364.tar.gz inkscape-60437ac397d41678daba5daece227240e8ddd364.zip | |
Upgrade to 2Geom r2413
(bzr r14059.2.18)
Diffstat (limited to 'src/2geom/path.h')
| -rw-r--r-- | src/2geom/path.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/2geom/path.h b/src/2geom/path.h index a6473e0d2..a2d1e751e 100644 --- a/src/2geom/path.h +++ b/src/2geom/path.h @@ -159,7 +159,7 @@ struct PathTime }; inline std::ostream &operator<<(std::ostream &os, PathTime const &pos) { - os << pos.curve_index << ": " << pos.t; + os << pos.curve_index << ": " << format_coord_nice(pos.t); return os; } @@ -313,9 +313,7 @@ struct ShapeTraits<Path> { * * @ingroup Paths */ class Path - : boost::equality_comparable1< Path - , MultipliableNoncommutative< Path, Affine - > > + : boost::equality_comparable< Path > { public: typedef PathInternal::Sequence Sequence; @@ -493,8 +491,24 @@ public: /// Test paths for exact equality. bool operator==(Path const &other) const; - /// Apply an affine transform. - Path &operator*=(Affine const &m); + /// Apply a transform to each curve. + template <typename T> + Path &operator*=(T const &tr) { + BOOST_CONCEPT_ASSERT((TransformConcept<T>)); + _unshare(); + for (std::size_t i = 0; i < _curves->size(); ++i) { + (*_curves)[i] *= tr; + } + return *this; + } + + template <typename T> + friend Path operator*(Path const &path, T const &tr) { + BOOST_CONCEPT_ASSERT((TransformConcept<T>)); + Path result(path); + result *= tr; + return result; + } /** @brief Get the allowed range of time values. * @return Values for which pointAt() and valueAt() yield valid results. */ |
