diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2025-10-17 19:58:35 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2025-10-17 19:59:26 -0400 |
| commit | 42af50b090f03e920368de3fd6872cf5b62c918e (patch) | |
| tree | dc032a7e20f35e96b45fec80b3287ade868af6b8 /graphics.c | |
| parent | 3e6eeaaf599f1082c02279bb9269de9644cdfab3 (diff) | |
fix spacing and sizing and shit
Diffstat (limited to 'graphics.c')
| -rw-r--r-- | graphics.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -142,21 +142,22 @@ void render_frame(client_state *state) { glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, state->atlas.texture); - - float pen_x = state->line_height / 4.0f; + float horizontal_spacing = state->line_height / 2.0f; + float pen_x = horizontal_spacing / 2.0f; float pen_y = state->line_height * state->lines - state->atlas.vert_shift; + // draw input buffer if (state->lines > 0) { glScissor(pen_x, pen_y + state->atlas.vert_shift, state->width, state->line_height); } else { glScissor(pen_x, pen_y + state->atlas.vert_shift, state->width / 3.0f - pen_x, state->line_height); } - // draw input buffer glBindVertexArray(state->input_buffer_grafix.vao); glUniform2f(state->offset_uniform, pen_x, pen_y); glDrawElements(GL_TRIANGLES, state->input_buffer_grafix.num_elements, GL_UNSIGNED_INT, 0); - // shift pen + + // set up drawing for options if (state->lines > 0) { glScissor(0, 0, state->width, pen_y); pen_y -= state->line_height; @@ -164,10 +165,9 @@ void render_frame(client_state *state) { else { pen_x += state->width / 3.0f; glScissor(pen_x, 0, state->width, state->line_height); + pen_x += horizontal_spacing / 2.0f; } - pen_x += state->line_height / 4.0f; - // draw options array_for_all(item_t, item, state->items) { glBindVertexArray(item->text_buffer.vao); @@ -179,7 +179,7 @@ void render_frame(client_state *state) { pen_y -= state->line_height; } else { - pen_x += item->pixel_len + (state->line_height / 2.0f); + pen_x += item->pixel_len + horizontal_spacing; } } |
