mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 04:04:59 -07:00
correctly use tab width px in new code slice fstrs measuring path
This commit is contained in:
+2
-2
@@ -187,10 +187,10 @@ dr_fruns_from_fstrs(Arena *arena, F32 tab_size_px, DR_FStrList *strs)
|
||||
}
|
||||
|
||||
internal Vec2F32
|
||||
dr_dim_from_fstrs(DR_FStrList *fstrs)
|
||||
dr_dim_from_fstrs(F32 tab_size_px, DR_FStrList *fstrs)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DR_FRunList fruns = dr_fruns_from_fstrs(scratch.arena, 0, fstrs);
|
||||
DR_FRunList fruns = dr_fruns_from_fstrs(scratch.arena, tab_size_px, fstrs);
|
||||
Vec2F32 dim = fruns.dim;
|
||||
scratch_end(scratch);
|
||||
return dim;
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ internal DR_FStrList dr_fstrs_copy(Arena *arena, DR_FStrList *src);
|
||||
internal String8 dr_string_from_fstrs(Arena *arena, DR_FStrList *list);
|
||||
internal FuzzyMatchRangeList dr_fuzzy_match_find_from_fstrs(Arena *arena, DR_FStrList *fstrs, String8 needle);
|
||||
internal DR_FRunList dr_fruns_from_fstrs(Arena *arena, F32 tab_size_px, DR_FStrList *strs);
|
||||
internal Vec2F32 dr_dim_from_fstrs(DR_FStrList *fstrs);
|
||||
internal Vec2F32 dr_dim_from_fstrs(F32 tab_size_px, DR_FStrList *fstrs);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Top-Level API
|
||||
|
||||
@@ -8920,7 +8920,7 @@ rd_window_frame(void)
|
||||
TabTask *t = push_array(scratch.arena, TabTask, 1);
|
||||
t->tab = tab;
|
||||
t->fstrs = rd_title_fstrs_from_cfg(scratch.arena, tab);
|
||||
F32 tab_width_target = dr_dim_from_fstrs(&t->fstrs).x + tab_close_width_px + ui_top_font_size()*1.f;
|
||||
F32 tab_width_target = dr_dim_from_fstrs(ui_top_tab_size(), &t->fstrs).x + tab_close_width_px + ui_top_font_size()*1.f;
|
||||
tab_width_target = Min(max_tab_width_px, tab_width_target);
|
||||
t->tab_width = floor_f32(ui_anim(ui_key_from_stringf(ui_key_zero(), "tab_width_%p", tab), tab_width_target, .initial = reset ? tab_width_target : 0, .rate = rd_state->menu_animation_rate));
|
||||
SLLQueuePush(first_tab_task, last_tab_task, t);
|
||||
|
||||
@@ -1954,7 +1954,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
|
||||
line_num += 1, line_idx += 1)
|
||||
{
|
||||
DR_FStrList line_fstrs = lines_fstrs[line_idx];
|
||||
F32 line_text_dim = dr_dim_from_fstrs(&line_fstrs).x + params->line_num_width_px + params->catchall_margin_width_px + params->priority_margin_width_px;
|
||||
F32 line_text_dim = dr_dim_from_fstrs(params->tab_size, &line_fstrs).x + params->line_num_width_px + params->catchall_margin_width_px + params->priority_margin_width_px;
|
||||
line_extras_off[line_idx] = Max(line_text_dim, params->font_size*30);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user