diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-04 13:44:30 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-04 14:04:17 -0500 |
| commit | 78ca2865441df428228d158796c346e1df75d302 (patch) | |
| tree | ebcbea508c88162c99fd3fa217aae79cc9440217 /src/font.cpp | |
| parent | 3ca179e53bb4840a88c95e26b7eb11b36e1830dd (diff) | |
pke: ui draws on screen as expected
Diffstat (limited to 'src/font.cpp')
| -rw-r--r-- | src/font.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/font.cpp b/src/font.cpp index 6a94d03..62b39f7 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -194,7 +194,7 @@ void FontType_Inner_CalcTransforms(const FontType *ft, FontRender *fr, FontInsta translate.x -= (Extent.width / 2.0); translate.x /= (Extent.width / 2.0); - // ((val) - (width/2)) / (width/2) + // ((val) - (height/2)) / (height/2) // box position translate.y = fr->settings.surface_area_pos.y; // baseline - current line (+1 to not draw above the box) @@ -254,11 +254,12 @@ void FontType_Tick(double delta) { for (FontTypeIndex_T i = 0; i < (FontTypeIndex_T)ftd.h_ft; ++i) { index = 0; ft = &ftd.arr_ft[i]; - if (ft->last_graphics_resize_index == pkeRuntime.graphics.resize_index) + if (pkeSettings.rt.was_framebuffer_resized == false && ft->gr.should_update_instance_buffer == false) { continue; + } if (ft->bindings.instanceCounter == 0) continue; - ft->last_graphics_resize_index = pkeRuntime.graphics.resize_index; + ft->gr.should_update_instance_buffer = false; // TODO specific bucket fibis = pk_new<FontInstanceBufferItem>(ft->bindings.instanceCounter); @@ -1295,8 +1296,7 @@ void FontType_RemoveStringRender(FontRenderHandle handle) { uint32_t buffer_start_index; FontType *ft = &ftd.arr_ft[(FontTypeIndex_T)handle.index_ft]; // hack, but works - assert(ft->last_graphics_resize_index > 0); - ft->last_graphics_resize_index -= 1; + ft->gr.should_update_instance_buffer = true; fr = &ft->renders[(FontRenderIndex_T)handle.index_fr]; ft->bindings.instanceCounter -= fr->n_glyphs; |
