On Wed, 31 Jul 2024 07:12:35 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

> Since  Math.round with integer argument returns the same value, and also 
> since all arguments and calculations in the 
> AquaProgressBarUI#getStringPlacement are integer arithmetic, Math.round is 
> redundant and can be removed

src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java line 259:

> 257:         }
> 258: 
> 259:         return new Point(x + (width / 2 - stringWidth / 2), y + ((height 
> + fontSizer.getAscent() - fontSizer.getLeading() - fontSizer.getDescent()) / 
> 2) - 1);

There was the same bug in the BasicProgressBarUI#getStringPlacement, but it 
seems it was fixed in the opposite way by replacing the "2" ->> "2.0", see 
https://github.com/openjdk/jdk/commit/338fb4d94a6a66b21ff39fccf541bbfb63251e6c

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20400#discussion_r1733593021

Reply via email to