fixed aabb transform func
[csRadar.git] / csRadar.c
index 2bde6027f01b26565f53b92a57d957aeb061f202..b05b6a6be3126ae06e7d385c4923f90bd7f99498 100644 (file)
--- a/csRadar.c
+++ b/csRadar.c
@@ -55,6 +55,8 @@ int main( int argc, char *argv[] )
                                exit(0);
                        }
                        
+                       printf( "got: %s\n", arg );
+                       
                        strings[ num_strings ++ ] = arg;
                }
                
@@ -154,28 +156,32 @@ int main( int argc, char *argv[] )
                                .visgroup = NULL,
                                .compute_bounds_only = 1
                        };
-                       draw_vmf_group( &target, map, map->root, &filter, NULL, NULL );
-                       csr_auto_fit( &target, padding );
-                       filter.compute_bounds_only = 0;
                        
-                       if( num_strings == 1 )
-                       {
-                               // Draw everything
-                               draw_vmf_group( &target, map, map->root, NULL, NULL, NULL );
-                               csr_rt_save_buffers( &target, output_path, "all" );
-                       }
-                       else
+                       // One pass for fitting, second pass for drawing
+                       for( int i = 0; i < 2; i ++ )
                        {
-                               // Draw groups
-                               for( int i = 1; i < num_strings; i ++ )
+                               if( num_strings == 1 )
                                {
-                                       filter.visgroup = strings[ i ];
-                                       
-                                       draw_vmf_group( &target, map, map->root, NULL, NULL, NULL );
-                                       csr_rt_save_buffers( &target, output_path, strings[i] );
-                                       
-                                       csr_rt_clear( &target );
+                                       // Draw everything
+                                       draw_vmf_group( &target, map, map->root, &filter, NULL, NULL );
+                                       csr_rt_save_buffers( &target, output_path, "all" );
+                               }
+                               else
+                               {
+                                       // Draw groups
+                                       for( int i = 1; i < num_strings; i ++ )
+                                       {
+                                               filter.visgroup = strings[ i ];
+                                               
+                                               draw_vmf_group( &target, map, map->root, &filter, NULL, NULL );
+                                               csr_rt_save_buffers( &target, output_path, strings[i] );
+                                               
+                                               csr_rt_clear( &target );
+                                       }
                                }
+                               
+                               filter.compute_bounds_only = 0;
+                               csr_auto_fit( &target, padding );
                        }
                        
                        if( write_txt )