From ac2b7943c81b0b59212209f1a8d6a407619ce1aa Mon Sep 17 00:00:00 2001 From: Dan Van Atta Date: Mon, 6 May 2024 15:01:22 -0700 Subject: [PATCH] Quick fix for download-map progress bars to be more accurate (#12567) Download length is currently always '-1', the negative values cause odd behavior. --- .../framework/map/download/MapDownloadProgressListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java index fe1fd204094..89dbafa1438 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java @@ -28,7 +28,7 @@ private void updateProgressBarWithPercentComplete( () -> { progressBar.setIndeterminate(false); progressBar.setString(null); - progressBar.setValue(percentComplete); + progressBar.setValue(Math.max(0, percentComplete)); progressBar.setToolTipText(toolTipText); }); }