-
CSR
-
Resolution: Approved
-
P3
-
None
-
behavioral
-
low
-
-
Java API
Summary
The getBounds2D() method in java.awt.geom.Path2D, java.awt.geom.CubicCurve2D and java.awt.geom.QuadCurve2D now return a more concise bounding box.
Problem
Without this change the getBounds2D() methods may return a bounding box based on the bezier control points of curves. Sometimes it would return a bounding box that has too much space between the visual bounds of the shape and the bounding box.
Solution
Update the implementation to be more precise in the returned bounding box. The caveat is that applications which used the imprecise bounds to (for example) size a UI may be adversely impacted. However that would definitely be an application bug.
Specification
There is no change to the Java SE specification for the affected methods which are
public Rectangle java.awt.geom.Path2D.getBounds(); public Rectangle java.awt.geom.CubicCurve2D.getBounds(); public Rectangle java.awt.geom.QuadCurve2D.getBounds();
- csr of
-
JDK-8176501 Method Shape.getBounds2D() incorrectly includes Bezier control points in bounding box
-
- Resolved
-