[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 8176501: Method Shape.getBounds2D() incorrectly includes Bezier control points in bounding 
From:       Laurent =?UTF-8?B?Qm91cmfDqHM=?= <lbourges () openjdk ! java ! net>
Date:       2021-11-25 9:27:09
Message-ID: 74CXyCEJCW15HLBIbK4UY-25yfztLQ_tTjeIzWBFiJ0=.bc1343fc-734c-4b58-892e-be4be68ffee0 () github ! com
[Download RAW message or body]

On Fri, 19 Nov 2021 19:09:54 GMT, Jeremy <duke@openjdk.java.net> wrote:

> > This removes code that relied on consulting the Bezier control points to \
> > calculate the Rectangle2D bounding box. Instead it's pretty straight-forward to \
> > convert the Bezier control points into the x & y parametric equations. At their \
> > most complex these equations are cubic polynomials, so calculating their extrema \
> > is just a matter of applying the quadratic formula to calculate their extrema. \
> > (Or in path segments that are quadratic/linear/constant: we do even less work.) 
> > The bug writeup indicated they wanted Path2D#getBounds2D() to be more \
> > accurate/concise. They didn't explicitly say they wanted CubicCurve2D and \
> > QuadCurve2D to become more accurate too. But a preexisting unit test failed when \
> > Path2D#getBounds2D() was updated and those other classes weren't. At this point I \
> > considered either: A. Updating CubicCurve2D and QuadCurve2D to use the new more \
> > accurate getBounds2D() or B. Updating the unit test to forgive the discrepancy.
> > 
> > I chose A. Which might technically be seen as scope creep, but it feels like a \
> > more holistic/better approach. 
> > Other shapes in java.awt.geom should not require updating, because they already \
> > identify concise bounds. 
> > This also includes a new unit test (in Path2D/UnitTest.java) that fails without \
> > the changes in this commit.
> 
> 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 feedback: "Use BigDecomal.setScale(40) to ascertain \
> precision." 
> The geom.* unit tests passed before & after this change.
> 
> https://github.com/openjdk/jdk/pull/6227#discussion_r752908494

Please consider this PR for review @prrace @mrserb ?

-------------

PR: https://git.openjdk.java.net/jdk/pull/6227


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic