fix run-list size calculation, accounting for advance vs. end pad

This commit is contained in:
Ryan Fleury
2024-06-22 20:29:38 -07:00
parent f9abb397f3
commit 16863b1f5a
3 changed files with 7 additions and 0 deletions
+5
View File
@@ -104,6 +104,11 @@ d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, F_RunFlag
run_list.dim.x += dst_n->v.run.dim.x;
run_list.dim.y = Max(run_list.dim.y, dst_n->v.run.dim.y);
base_align_px += dst_n->v.run.dim.x;
if(n->next != 0)
{
run_list.dim.x -= dst_n->v.run.end_pad;
base_align_px -= dst_n->v.run.end_pad;
}
}
ProfEnd();
return run_list;
+1
View File
@@ -839,6 +839,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32
}
run.dim = dim;
run.dim.x += last_piece_end_pad;
run.end_pad = last_piece_end_pad;
run.ascent = hash2style_node->ascent;
run.descent = hash2style_node->descent;
}
+1
View File
@@ -71,6 +71,7 @@ struct F_Run
{
F_PieceArray pieces;
Vec2F32 dim;
F32 end_pad;
F32 ascent;
F32 descent;
};