From: Niki Roo Date: Thu, 23 Nov 2017 18:10:12 +0000 (+0100) Subject: Fix progress X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=356c0336f9ef77f298f1e7d683acace117ef46ad;p=fanfix-jexer.git Fix progress --- diff --git a/src/be/nikiroo/utils/Progress.java b/src/be/nikiroo/utils/Progress.java index d722fc9..ae59603 100644 --- a/src/be/nikiroo/utils/Progress.java +++ b/src/be/nikiroo/utils/Progress.java @@ -293,14 +293,18 @@ public class Progress { * @return TRUE if it is */ public boolean isDone() { - return relativeProgress >= 1d; + return getProgress() == max; } /** * Mark the {@link Progress} as done by setting its value to max. */ public void done() { - setProgress(getMax()); + synchronized (getLock()) { + double childrenProgress = relativeProgress - relativeLocalProgress; + relativeLocalProgress = 1 - childrenProgress; + setRelativeProgress(this, name, 1d); + } } /**