From: Johan E. <jbc...@sw...> - 2014-03-23 14:08:01
|
Hi all, I finally came around to finishing this (initial) work, and have committed it to trunk. After Inkscape's release, we really have to look much further into this. I think it is a huge burden and slowdown to not have Curves be closed under arbitrary Affine. As Krzysztof mentioned, it is probably not worth keeping HLineSeg and VLineSeg because of this. regards, Johan On 13-11-2013 17:44, Johan Engelen wrote: > On 13-11-2013 16:50, Krzysztof Kosiński wrote: >> 2013/11/12 Johan Engelen <jbc...@sw...>: >>> As far as I can see now, all (current) Curve types *are* closed under >>> translations. I think we should enforce this for Curve. I.e., each >>> Curve >>> must implement >>> virtual Curve &operator+=(Point const &); >> I think the method should be: >> virtual Curve &operator*=(Translate const &t) { >> *this *= Affine(t); >> return *this; >> } >> >> Rationale: >> 1. It's not immediately obvious what adding a point to a curve means. >> For instance, for BezierCurve it might plausibly mean adding a control >> point. > > Ok, that makes sense. > >> 2. For curves that don't implement the specialization, we just >> multiply by a generic affine. > > This is not possible. Because curves are not closed under Affine > transform, there is no operator*=(Affine). If you want to transform a > Curve, you have to call > Curve* Curve::transformed(Affine const&) > > I'll clean up the work and commit my changes, so you can see. > > Cheers, > Johan > > |