Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
branc116 committed Dec 24, 2024
1 parent f498edc commit 80ce4ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ npm-imgui:
((cd packages/npm && \
npm publish || cd ../..) && cd ../..)

.generated/default_font.h: bin/font_bake content/font.ttf
.generated/default_font.h: bin/font_bake content/font.subset.ttf
test -d .generated || mkdir .generated
bin/font_bake content/font.ttf > .generated/default_font.h
bin/font_bake content/font.subset.ttf > .generated/default_font.h

bin/font_bake: tools/font_bake.c $(NOBS)
$(NATIVE_CC) -O3 -o bin/font_bake tools/font_bake.c
Expand Down
2 changes: 1 addition & 1 deletion src/plotter.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void draw_grid_numbers(br_text_renderer_t* tr, br_plot_t* plot) {
while (i < 50.f) {
float cur = start + base * i;
i += 1.f;
sprintf(scrach, "%.*f", exp < 0 ? -(int)exp : 0, cur);
sprintf(scrach, "%.*f", exp < 0 ? -(int)exp : 1, cur);
help_trim_zeros(scrach);
float x = (sz.width / r.width) * (cur - r.x);
if (x > sz.width) break;
Expand Down
4 changes: 3 additions & 1 deletion src/text_renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ void br_text_renderer_dump(br_text_renderer_t* r) {
}
br_shader_font_t* simp = *r->shader;
simp->uvs.atlas_uv = r->bitmap_texture_id;
br_shader_font_draw(simp);
simp->len = 0;
}

static void br_text_draw_quad(br_vec4_t* v, int* len, float x0, float y0, float s0, float t0,
Expand Down Expand Up @@ -233,7 +235,7 @@ br_text_renderer_extent_t br_text_renderer_push2(br_text_renderer_t* r, float x,
else if (ancor & br_text_renderer_ancor_x_mid) x_off = (max_x + min_x) * 0.5f - x;
else if (ancor & br_text_renderer_ancor_x_right) x_off = max_x - x;
for (size_t i = 0; i < r->tmp_quads.len; ++i) {
if (simp->len * 3 >= simp->cap) {
if (simp->len >= simp->cap) {
br_text_renderer_dump(r);
len_pos = 0;
pos = (void*)simp->pos_vbo;
Expand Down
12 changes: 0 additions & 12 deletions tools/unity/brplot.cpp

This file was deleted.

0 comments on commit 80ce4ad

Please sign in to comment.