8205535: Useless (or buggy) call to Math.round on int input

Reviewed-by: jdv
This commit is contained in:
Prasanta Sadhukhan 2018-07-25 15:36:37 +05:30
parent f921743302
commit 338fb4d94a

View File

@ -874,7 +874,7 @@ public class BasicProgressBarUI extends ProgressBarUI {
progressString);
if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
return new Point(x + Math.round(width/2 - stringWidth/2),
return new Point(x + (int)Math.round(width/2.0 - stringWidth/2.0),
y + ((height +
fontSizer.getAscent() -
fontSizer.getLeading() -
@ -882,7 +882,7 @@ public class BasicProgressBarUI extends ProgressBarUI {
} else { // VERTICAL
return new Point(x + ((width - fontSizer.getAscent() +
fontSizer.getLeading() + fontSizer.getDescent()) / 2),
y + Math.round(height/2 - stringWidth/2));
y + (int)Math.round(height/2.0 - stringWidth/2.0));
}
}