From 66badda8021c516b22e5e781a7041d18a349d3cc Mon Sep 17 00:00:00 2001 From: Krone Date: Mon, 24 Mar 2025 22:57:12 -0300 Subject: [PATCH] Take screen padding into account --- src/renderer/opengl/custom.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/opengl/custom.zig b/src/renderer/opengl/custom.zig index 410b2f3b3..45a9308a6 100644 --- a/src/renderer/opengl/custom.zig +++ b/src/renderer/opengl/custom.zig @@ -185,8 +185,8 @@ pub const State = struct { // Update the cursor related uniforms pub fn addCursor(self: *State, size: Size, cursor: Screen.Cursor, cursor_style: CursorStyle, glyph: Glyph) void { - const current_x: f32 = @as(f32, @floatFromInt(cursor.x * size.cell.width)) + @as(f32, @floatFromInt(glyph.offset_x)); - const current_y: f32 = @as(f32, @floatFromInt(size.screen.height - (cursor.y + 1) * size.cell.height)) + @as(f32, @floatFromInt(glyph.offset_y)); + const current_x: f32 = @as(f32, @floatFromInt(cursor.x * size.cell.width + size.padding.left)) + @as(f32, @floatFromInt(glyph.offset_x)); + const current_y: f32 = @as(f32, @floatFromInt(size.screen.height - size.padding.top - (cursor.y + 1) * size.cell.height)) + @as(f32, @floatFromInt(glyph.offset_y)); const cursor_width: f32 = if (cursor_style == .bar) 1.0 else @floatFromInt(glyph.width); const cursor_height: f32 = @floatFromInt(glyph.height);