Commit: ddac5dfbaa26b8b480979dc2e43e939b22a17002
Parent: 1380c3667211e7147d30210f418a18c8f237a630
Author: Randy Palamar
Date: Mon, 2 Sep 2024 15:46:46 -0600
FontAtlas: rename deltay to baseline
Diffstat:
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/font.c b/font.c
@@ -187,10 +187,10 @@ update_font_metrics(FontAtlas *fa)
{
i32 x0, x1, y0, y1;
stbtt_GetFontBoundingBox(&fa->fonts[0][FS_NORMAL].font_info, &x0, &y0, &x1, &y1);
- f32 scale = fa->fonts[0][FS_NORMAL].stbtt_scale;
- fa->size.h = scale * (y1 - y0) + 0.5;
- fa->size.w = scale * (x1 - x0) + 0.5;
- fa->deltay = -scale * y0 + 0.5;
+ f32 scale = fa->fonts[0][FS_NORMAL].stbtt_scale;
+ fa->size.h = scale * (y1 - y0) + 0.5;
+ fa->size.w = scale * (x1 - x0) + 0.5;
+ fa->baseline = -scale * y0 + 0.5;
}
static void
diff --git a/util.h b/util.h
@@ -332,7 +332,7 @@ typedef struct {
FontFamily *fonts;
u32 nfonts;
uv2 size;
- i32 deltay;
+ i32 baseline;
GlyphCache glyph_cache;
} FontAtlas;
diff --git a/vtgl.c b/vtgl.c
@@ -360,7 +360,7 @@ render_framebuffer(Term *t, RenderPushBuffer *rpb)
Rect cr = {.pos = {.x = tl.x, .y = tl.y - cs.h}, .size = cs};
v2 cell_font_delta = get_cell_pad_off();
- cell_font_delta.y += t->fa.deltay;
+ cell_font_delta.y += t->fa.baseline;
TermView *tv = t->views + t->view_idx;
/* NOTE: draw whole framebuffer */