From e9d16387aea906e49c1620a7767e9b2e7cfe82ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C5=93ur?= Date: Sat, 16 Mar 2024 06:45:31 +0800 Subject: [PATCH] fix multipleRatioLimits (#6698) * fix multipleRatioLimits * fix building on macOS 11 --- macosx/InfoOptionsViewController.mm | 2 +- macosx/Utils.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/macosx/InfoOptionsViewController.mm b/macosx/InfoOptionsViewController.mm index 56986b9c2..a043a2d6f 100644 --- a/macosx/InfoOptionsViewController.mm +++ b/macosx/InfoOptionsViewController.mm @@ -296,7 +296,7 @@ static CGFloat const kStackViewSpacing = 8.0; checkRatio = kInvalidValue; } - if (!multipleRatioLimits && isRatioEqual(ratioLimit, torrent.ratioLimit)) + if (!multipleRatioLimits && !isRatioEqual(ratioLimit, torrent.ratioLimit)) { multipleRatioLimits = YES; } diff --git a/macosx/Utils.h b/macosx/Utils.h index 311054c8c..51df39f7e 100644 --- a/macosx/Utils.h +++ b/macosx/Utils.h @@ -2,7 +2,9 @@ // It may be used under the MIT (SPDX: MIT) license. // License text can be found in the licenses/ folder. -#import +#import +// 0.1 precision bool isSpeedEqual(CGFloat old_speed, CGFloat new_speed); +// 0.01 precision bool isRatioEqual(CGFloat old_ratio, CGFloat new_ratio);