From ac8120f0731b7aa89520abc7a6eff5edaa9c45e8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 19 Apr 2022 09:02:50 -0700 Subject: [PATCH] update some comments --- shaders/cell.v.glsl | 4 +++- src/Grid.zig | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/shaders/cell.v.glsl b/shaders/cell.v.glsl index 97c8ea715..722d2ec20 100644 --- a/shaders/cell.v.glsl +++ b/shaders/cell.v.glsl @@ -61,7 +61,9 @@ void main() { gl_Position = projection * vec4(cell_pos, 0.0, 1.0); color = bg_color_in / 255.0; } else { - // TODO: why? + // The glyph offset is upside down so we need to reverse it to + // be based on the offset of our cell. This is equivalent to + // "1 - value" to flip the value. vec2 glyph_offset_calc = glyph_offset; glyph_offset_calc.y = cell_size.y - glyph_offset.y; diff --git a/src/Grid.zig b/src/Grid.zig index b6b18d35c..14e84001a 100644 --- a/src/Grid.zig +++ b/src/Grid.zig @@ -245,6 +245,7 @@ pub fn updateCells(self: *Grid, term: Terminal) !void { if (cell.empty()) continue; // Get our glyph + // TODO: if we add a glyph, I think we need to rerender the texture. const glyph = try self.font_atlas.addGlyph(self.alloc, cell.char); self.cells.appendAssumeCapacity(.{