Integrated: 4197755: Arc2D.getBounds() returns an unnecessarily large bounding box
Jeremy Wood
jwood at openjdk.org
Fri Feb 13 19:37:09 UTC 2026
On Sun, 10 Aug 2025 04:35:43 GMT, Jeremy Wood <jwood at openjdk.org> wrote:
> 4197755 is marked as a duplicate of [JDK-8176501](https://bugs.openjdk.org/browse/JDK-8176501) , but I think that is a mistake. The complaint in that ticket still reproduces, and it is resolved in this PR.
>
> The complaint is: Arc2D.getBounds() is too large. If an Arc2D represents a small slice of an ellipse, then Arc2D.getBounds() always returns the size of the total ellipse. Arc2D.getBounds2D(), by contrast, has been "high-precision" for decades.
>
> This PR makes Arc2D.getBounds() resemble the same implementation already used in Area, CubicCurve2D, Line2D, Path2D, and QuadCurve2D:
>
> public Rectangle getBounds() {
> return getBounds2D().getBounds();
> }
>
>
> This modifies (simplifies) the javadoc for Arc2D.getBounds2D(). If we generally like this PR I assume we'll need a CSR to approve the javadoc change.
This pull request has now been integrated.
Changeset: a98d3a76
Author: Jeremy Wood <jwood at openjdk.org>
Committer: Phil Race <prr at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/a98d3a76a5d44096321aa02ed86e865066c89bdc
Stats: 112 lines in 2 files changed: 98 ins; 12 del; 2 mod
4197755: Arc2D.getBounds() returns an unnecessarily large bounding box
Reviewed-by: prr, psadhukhan
-------------
PR: https://git.openjdk.org/jdk/pull/26715
More information about the client-libs-dev
mailing list