fix: use double instead of CGFloat for mjpegScalingFactor public API#1168
Open
AsijitM wants to merge 1 commit into
Open
fix: use double instead of CGFloat for mjpegScalingFactor public API#1168AsijitM wants to merge 1 commit into
AsijitM wants to merge 1 commit into
Conversation
50fa05c to
8285ba5
Compare
|
I would rather prefer to explicitly use Double as type for settings. CGFloat is an internal implementation detail |
`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).
8285ba5 to
de63ba7
Compare
Author
|
Good call — updated. Instead of importing CoreGraphics, I switched |
KazuCocoa
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
FBConfiguration.hexposedCGFloatin its public interface:+ (CGFloat)mjpegScalingFactor; + (void)setMjpegScalingFactor:(CGFloat)scalingFactor;CGFloatis a CoreGraphics type, so the header depended on CoreGraphics even though it only importsFoundation (it compiled only via a transitive
Foundation → NSGeometry → CoreGraphicschain).Fix (updated per review)
Rather than import CoreGraphics to prop up a
CGFloatpublic API, switch the public getter/setter — and thebacking static — to
double.CGFloatstays out of the public settings surface entirely, and the headerbecomes self-contained with no CoreGraphics dependency.
No behaviour change (
CGFloatisdoubleon 64-bit). Files:FBConfiguration.{h,m}.