From 356c0336f9ef77f298f1e7d683acace117ef46ad Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 23 Nov 2017 19:10:12 +0100 Subject: [PATCH] Fix progress --- src/be/nikiroo/utils/Progress.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/be/nikiroo/utils/Progress.java b/src/be/nikiroo/utils/Progress.java index d722fc91..ae596037 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); + } } /** -- 2.27.0