8337457: Redundant Math.round call in AquaProgressBarUI#getStringPlacement

Reviewed-by: azvegint
This commit is contained in:
Prasanta Sadhukhan 2024-08-01 03:35:43 +00:00
parent 8af2ef35b6
commit 65646b5f81

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -256,7 +256,7 @@ public class AquaProgressBarUI extends ProgressBarUI implements ChangeListener,
y = oldX;
}
return new Point(x + Math.round(width / 2 - stringWidth / 2), y + ((height + fontSizer.getAscent() - fontSizer.getLeading() - fontSizer.getDescent()) / 2) - 1);
return new Point(x + (width / 2 - stringWidth / 2), y + ((height + fontSizer.getAscent() - fontSizer.getLeading() - fontSizer.getDescent()) / 2) - 1);
}
static Dimension getCircularPreferredSize() {