From de63ba7e4e5fad7e5b24949d9c1980ddb96eb835 Mon Sep 17 00:00:00 2001 From: Asijit Manna Date: Mon, 6 Jul 2026 20:40:38 +0530 Subject: [PATCH] fix: use double instead of CGFloat for mjpegScalingFactor public API `FBConfiguration.h` exposed `mjpegScalingFactor` / `setMjpegScalingFactor:` using `CGFloat`. CGFloat is a CoreGraphics implementation detail and shouldn't leak into the public settings API; it also forced the header to depend on CoreGraphics (the header only imports Foundation). Switch the public getter/setter (and the backing static) to `double`, so the header is self-contained without a CoreGraphics import and the settings surface uses a plain scalar type. No behavior change (CGFloat is `double` on 64-bit). --- WebDriverAgentLib/Utilities/FBConfiguration.h | 4 ++-- WebDriverAgentLib/Utilities/FBConfiguration.m | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WebDriverAgentLib/Utilities/FBConfiguration.h b/WebDriverAgentLib/Utilities/FBConfiguration.h index 94ff68ee0..ec7b2eb81 100644 --- a/WebDriverAgentLib/Utilities/FBConfiguration.h +++ b/WebDriverAgentLib/Utilities/FBConfiguration.h @@ -144,8 +144,8 @@ extern NSString *const FBSnapshotMaxDepthKey; ! Setting this to a value less than 100, especially together with orientation fixing enabled ! may lead to WDA process termination because of an excessive CPU usage. */ -+ (CGFloat)mjpegScalingFactor; -+ (void)setMjpegScalingFactor:(CGFloat)scalingFactor; ++ (double)mjpegScalingFactor; ++ (void)setMjpegScalingFactor:(double)scalingFactor; /** YES if verbose logging is enabled. NO otherwise. diff --git a/WebDriverAgentLib/Utilities/FBConfiguration.m b/WebDriverAgentLib/Utilities/FBConfiguration.m index fa856d967..3671d4323 100644 --- a/WebDriverAgentLib/Utilities/FBConfiguration.m +++ b/WebDriverAgentLib/Utilities/FBConfiguration.m @@ -37,7 +37,7 @@ static BOOL FBShouldUseSingletonTestManager = YES; static BOOL FBShouldRespectSystemAlerts = NO; -static CGFloat FBMjpegScalingFactor = 100.0; +static double FBMjpegScalingFactor = 100.0; static BOOL FBMjpegShouldFixOrientation = NO; static NSUInteger FBMjpegServerScreenshotQuality = 25; static NSUInteger FBMjpegServerFramerate = 10; @@ -178,12 +178,12 @@ + (UInt64)httpRequestBodySizeLimit return DefaultHttpRequestBodySizeLimit; } -+ (CGFloat)mjpegScalingFactor ++ (double)mjpegScalingFactor { return FBMjpegScalingFactor; } -+ (void)setMjpegScalingFactor:(CGFloat)scalingFactor { ++ (void)setMjpegScalingFactor:(double)scalingFactor { FBMjpegScalingFactor = scalingFactor; }