Skip to content

4197755: Arc2D.getBounds() returns an unnecessarily large bounding box #26715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mickleness
Copy link
Contributor

@mickleness mickleness commented Aug 10, 2025

4197755 is marked as a duplicate of 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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-4197755: Arc2D.getBounds() returns an unnecessarily large bounding box (Bug - P4) ⚠️ Issue is not open.

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26715/head:pull/26715
$ git checkout pull/26715

Update a local copy of the PR:
$ git checkout pull/26715
$ git pull https://git.openjdk.org/jdk.git pull/26715/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26715

View PR using the GUI difftool:
$ git pr show -t 26715

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26715.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 10, 2025

👋 Welcome back jwood! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 10, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Aug 10, 2025

@mickleness The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added client [email protected] rfr Pull request is ready for review labels Aug 10, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 10, 2025

Webrevs

@bourgesl
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants