From 65646b5f81279a7fcef3ea04ef9894cf66f77a5a Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Thu, 1 Aug 2024 03:35:43 +0000 Subject: [PATCH] 8337457: Redundant Math.round call in AquaProgressBarUI#getStringPlacement Reviewed-by: azvegint --- .../macosx/classes/com/apple/laf/AquaProgressBarUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java index bf66a1b4b08..71500f3a95c 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java @@ -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() {