Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RNSVG.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.requires_arc = true

if fabric_enabled
s.platforms = { :osx => "10.14", ios: '12.4', tvos: '11.0' }
s.platforms = { :osx => "10.14", ios => "12.4", tvos => "11.0", :visionos => "1.0" }
install_modules_dependencies(s)

s.subspec "common" do |ss|
Expand All @@ -28,7 +28,7 @@ Pod::Spec.new do |s|
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp\"" }
end
else
s.platforms = { :osx => "10.14", :ios => "10.0", :tvos => "9.2" }
s.platforms = { :osx => "10.14", :ios => "10.0", :tvos => "9.2", :visionos => "1.0" }
s.exclude_files = 'apple/Utils/RNSVGFabricConversions.h'
s.dependency 'React-Core'
end
Expand Down
11 changes: 9 additions & 2 deletions apple/RNSVGRenderable.mm
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,17 @@ - (void)renderTo:(CGContextRef)context rect:(CGRect)rect
CGSize boundsSize = bounds.size;
CGFloat height = boundsSize.height;
CGFloat width = boundsSize.width;
CGFloat scale = 0.0;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've initialized scale to 0.0 to suppress this warning:

CleanShot 2023-12-06 at 12 44 09@2x

#if TARGET_OS_OSX
CGFloat scale = [[NSScreen mainScreen] backingScaleFactor];
scale = [[NSScreen mainScreen] backingScaleFactor];
#else
CGFloat scale = [[UIScreen mainScreen] scale];
if (@available(iOS 13.0, *)) {
scale = [UITraitCollection currentTraitCollection].displayScale;
} else {
#if !TARGET_OS_VISION
scale = [[UIScreen mainScreen] scale];
#endif
}
#endif // TARGET_OS_OSX
NSUInteger iheight = (NSUInteger)height;
NSUInteger iwidth = (NSUInteger)width;
Expand Down