Hi all…
I’m trying to calculate the middle point of a Path object.
All works fine if I call the method getPointAlongPath, but i have some strange results while trying to
perform the same operation on a modified Path.
Here’s the code:
Path p;
p.lineTo(100,0); /*should draw a straight line from 0,0 to 100,0*/
Point<float> coord = p.getPointAlongPath(50); /* coord (50,0) -- i found the right value*/
Point <float> coord2 = p.getPointAlongPath(50, (AffineTransform::translation(20,20))); /* if i understood this method should calculate the position alogn the path after the translation -- i found the right value : coord2 (70,20)*/
Point <float> coord3 = p.getPointAlongPath(50, (AffineTransform::scale(2,2))); /* here some problem - coord3(50,0) expected (100,0) becuase the width is double (2 * 100)*/
Does the method getPointAlongPath (called with a AffineTransform as second parameter) calculate the position along the path of the given point after having transformed the path?
If it is like said before, why doesn’t work with AffineTransform::scale? Am I misunderstanding something about Path operations in general?
thanks
