renderer: add custom shader cursor uniforms

Based on / supersedes PR #6912, implements discussion #6901

Co-authored-by: Krone Corylus <ahustinkrone@gmail.com>
This commit is contained in:
Qwerasd
2025-06-22 10:28:39 -06:00
parent c7a7474be0
commit bb576d1340
6 changed files with 75 additions and 5 deletions

View File

@@ -50,7 +50,11 @@ pub fn renderGlyph(
const region = try canvas.writeAtlas(alloc, atlas);
return font.Glyph{
.width = width,
// HACK: Set the width for the bar cursor to just the thickness,
// this is just for the benefit of the custom shader cursor
// uniform code. -- In the future code will be introduced to
// auto-crop the canvas so that this isn't needed.
.width = if (sprite == .cursor_bar) thickness else width,
.height = height,
.offset_x = 0,
.offset_y = @intCast(height),