Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ellipse rotated incorrectly in test file with ellipse next to a square #2
(Imported from http://code.google.com/p/diagrams/issues/detail?id=7. Original issue from byor...@gmail.com on December 24, 2010, 10:15:48 PM UTC)
See the attached test file.
The ellipse is rotated the wrong way and intersects with the square. Note that adding a rotation to the square (even a very small one) causes the ellipse to suddenly flip the correct way around and everything seems correct.
(Imported. Original comment by byor...@gmail.com on January 15, 2011, 01:03:57 AM UTC)
Oh man, this was a really sneaky one. I'm amazed that we ended up tripping over this bug as soon as we did, and it makes me wonder how many other sneaky, hard-to-trigger bugs are still lurking on the source... basically, the fix was to change
ellipseAngle :: Ellipse -> Angle
See the difference? From the darcs patch comment:
To be honest, I don't quite understand what is going on here. But the
(Imported. Original comment by fryguy...@gmail.com on January 15, 2011, 09:49:23 PM UTC)
I made some more changes here and now both ellipseAngle and ellipseScale are written in terms of a new ellipseAxes function. The ellipseAngle in terms of ellipseCoeffs would return negative angles in some cases. It think this was due to differences in the range of acot and atan. I also added some tests in diagrams-cairo/test for these functions.