From 505439593449af1dbbcf62519491d2d828d15cac Mon Sep 17 00:00:00 2001 From: IridiumIO Date: Fri, 28 Jun 2024 13:05:34 +1000 Subject: [PATCH] Fix #429 --- CompactGUI.Watcher/Watcher.vb | 2 +- CompactGUI/Views/MainWindow.xaml | 15 +++---------- CompactGUI/Views/MainWindow.xaml.vb | 34 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/CompactGUI.Watcher/Watcher.vb b/CompactGUI.Watcher/Watcher.vb index 36cd6f6..65778c9 100644 --- a/CompactGUI.Watcher/Watcher.vb +++ b/CompactGUI.Watcher/Watcher.vb @@ -224,7 +224,7 @@ Public Class WatchedFolder : Inherits ObservableObject Public ReadOnly Property DecayPercentage As Decimal Get If LastCompressedSize = 0 Then Return 1 - Return Math.Clamp((LastCheckedSize - LastCompressedSize) / (LastUncompressedSize - LastCompressedSize), 0, 1) + Return If(LastUncompressedSize = LastCompressedSize OrElse LastCompressedSize > LastUncompressedSize, 0D, Math.Clamp((LastCheckedSize - LastCompressedSize) / (LastUncompressedSize - LastCompressedSize), 0, 1)) End Get End Property diff --git a/CompactGUI/Views/MainWindow.xaml b/CompactGUI/Views/MainWindow.xaml index 8ff35db..456e311 100644 --- a/CompactGUI/Views/MainWindow.xaml +++ b/CompactGUI/Views/MainWindow.xaml @@ -1156,7 +1156,7 @@ - +