File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed 
Sources/MetalBuilder/Uniforms Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -52,18 +52,26 @@ public struct UniformsView: View {
5252                } 
5353            } 
5454        } 
55-         . onChange ( of:  uniforms. bufferAllocated) {  _ in 
56-             loadInitial ( ) 
57-             if  uniforms. saveToDefaults && !defaultsLoaded{ 
58-                 print ( " loadDef " ) 
59-                 loadFomDefaults ( ) 
60-                 defaultsLoaded =  true 
55+         . onAppear { 
56+             if  uniforms. bufferAllocated{ 
57+                startup ( ) 
6158            } 
6259        } 
60+         . onChange ( of:  uniforms. bufferAllocated) {  _ in 
61+             startup ( ) 
62+         } 
6363    } 
6464} 
6565//private methods
6666extension  UniformsView { 
67+     func  startup( ) { 
68+         loadInitial ( ) 
69+         if  uniforms. saveToDefaults && !defaultsLoaded{ 
70+             print ( " loadDef " ) 
71+             loadFomDefaults ( ) 
72+             defaultsLoaded =  true 
73+         } 
74+     } 
6775    func  saveToDefaults( value:  [ Float ] ,  name:  String ) { 
6876        let  key  =  keyForName ( name) 
6977        print ( " saved  " + key,  value) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments