[OpenJDK 2D-Dev] RFC: Fix for 7036754

Denis Lila dlila at redhat.com
Fri Apr 15 17:38:46 UTC 2011


Hi.

Jim Graham pointed out this bug to me.

A fix is here:
http://icedtea.classpath.org/~dlila/webrevs/7036754/webrev/

It just checks for inf/nan and just emits a line joining
the endpoints in that case.

The stroking is no longer symmetric with respect to right
and left polynomial degrees. This is a bit more general.

I have a question:

The "curve is a straight line" check I use is this:
 737         float dotsq = (dx1 * dx3 + dy1 * dy3);
 738         dotsq = dotsq * dotsq;
 739         float l1sq = dx1 * dx1 + dy1 * dy1, l3sq = dx3 * dx3 + dy3 * dy3;
 740         if (Helpers.within(dotsq, l1sq * l3sq, 4 * Math.ulp(dotsq))) {

However, this isn't making much sense mathematically
right now. I would like to avoid redoing the math
so if someone can quickly confirm/deny that it works
that would be nice.

Thank you,
Denis.



More information about the 2d-dev mailing list