From 186bbb03d12b006757860cbbe6eb95f9eb4bae5f Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 3 Feb 2018 18:55:33 +0100 Subject: [PATCH] One more bugfix for PDF conversion --- Logic/Support/PdfProcessor.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Logic/Support/PdfProcessor.cs b/Logic/Support/PdfProcessor.cs index 4f51f134..76f6a926 100644 --- a/Logic/Support/PdfProcessor.cs +++ b/Logic/Support/PdfProcessor.cs @@ -130,6 +130,9 @@ namespace Swarmops.Logic.Support } } + // Set progress to 100% to avoid rounding errors freezing the UI at 99% + + BroadcastProgress(organization, guid, 100); return result; } @@ -192,7 +195,7 @@ namespace Swarmops.Logic.Support } } - progress = progressRange.Minimum + progressRange.Range / 2 + (pageCounter + 1) * progressRange.Range / pdfPageCount; + progress = progressRange.Minimum + progressRange.Range / 2 + ((pageCounter + 1) * progressRange.Range / pdfPageCount) / 2; if (progress > lastProgress) { BroadcastProgress(organization, guid, progress);