RFR: 8176501: Method Shape.getBounds2D() incorrectly includes Bezier control points in bounding box [v5]
Jeremy
duke at openjdk.java.net
Tue Nov 16 05:27:39 UTC 2021
On Tue, 9 Nov 2021 10:34:11 GMT, Laurent Bourgès <lbourges at openjdk.org> wrote:
>> Jeremy has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8176501: Method Shape.getBounds2D() incorrectly includes Bezier control points in bounding box
>>
>> Addressing code review recommendation to calculate polynomial coefficients using differences / vector notation.
>>
>> https://github.com/openjdk/jdk/pull/6227#discussion_r743534560
>>
>> I generally understand the intention of this change, but I don't know exactly how to test/evaluate it.
>>
>> The unit tests still pass. I ran some sample calculations involving a 100x100 Ellipse2D as it was rotated, and the two getBounds2D(..) implementations (before and after this commit) only differed by a few ulps (usually around 10^-15), as expected.
>
> Great !
> I see many duplicated lines, probably it is time to add 2 small methods to processCubic() and processQuad() that can be called on x and y equations => only 2 arrays needed for coeff and deriv_coeff.
> Maybe I prefer the previous unified solution relying on QuadCurve2D.solveQuadratic() that handles both case.
@bourgesl : I refactored things just now to address the "many duplicated lines" comment. At your convenience please me know if the current branch looks/feels better, or if you have other recommendations in mind.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6227
More information about the client-libs-dev
mailing list