more gui changes
[carveJwlIkooP6JGAAIwe30JlM.git] / gui.h
diff --git a/gui.h b/gui.h
index a84835d99108b30e0004a4824462bb1f742ae115..5b662b234f9164a60254b6fd8b042cdb4ab673c2 100644 (file)
--- a/gui.h
+++ b/gui.h
@@ -189,7 +189,6 @@ static void gui_draw(void){
    v3_zero( mmdl[3] );
 
    float pad = dy*0x1p-4f*0.125f;
-   mmdl[3][0] = pad*2.0f;
    mmdl[3][1] = pad;
 
    for( u32 i=0; i<gui.helper_count; i++ ){
@@ -200,6 +199,10 @@ static void gui_draw(void){
       vg_strnull( &str, buf, sizeof(buf) );
       vg_input_string( &str, helper->binding, 1 );
 
+      f32 bs = (f32)vg.window_x / (f32)(gui.helper_count+1),
+          x  = ((f32)i + 1.0f) * bs;
+      mmdl[3][0] = x - font3d_string_width( 2, buf )*0.5f*scale;
+
       font3d_setcolour( (v4f){1.0f,1.0f,1.0f, helper->greyed? 0.5f: 1.0f} );
       font3d_simple_draw( 2, buf, &ortho, mmdl );
 
@@ -208,7 +211,6 @@ static void gui_draw(void){
       font3d_draw( helper->text );
       
       float w = gui_font3d.offset[0]+1.0f;
-      mmdl[3][0] += w*scale;
    }
 }