File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed 
Sources/OpenSwiftUICore/Layout Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ //
2+ //  SpacingLayout.swift
3+ //  OpenSwiftUICore
4+ //
5+ //  Audited for 6.5.4
6+ //  Status: Complete
7+ 
8+ import  OpenCoreGraphicsShims
9+ 
10+ struct  SpacingLayout :  UnaryLayout  { 
11+     var  spacing :  Spacing 
12+ 
13+     func  spacing( in context:  SizeAndSpacingContext ,  child:  LayoutProxy )  ->  Spacing  { 
14+         spacing
15+     } 
16+ 
17+     func  placement( of child:  LayoutProxy ,  in context:  PlacementContext )  ->  _Placement  { 
18+         _Placement ( 
19+             proposedSize:  context. proposedSize, 
20+             aligning:  . center, 
21+             in:  context. size
22+         ) 
23+     } 
24+ 
25+     func  sizeThatFits( in proposedSize:  _ProposedSize ,  context:  SizeAndSpacingContext ,  child:  LayoutProxy )  ->  CGSize  { 
26+         child. size ( in:  proposedSize) 
27+     } 
28+ } 
29+ 
30+ extension  View  { 
31+     package   func  spacing( _ spacing:  Spacing )  ->  some  View  { 
32+         modifier ( SpacingLayout ( spacing:  spacing) ) 
33+     } 
34+ } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments