From 6917bcacad036e89d9efa666b0e607d840067d2c Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Thu, 8 Aug 2024 11:13:30 -0400 Subject: [PATCH] font/sprite: fix 1px gap at right edge of dotted and dashed underlines --- src/font/sprite/underline.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/font/sprite/underline.zig b/src/font/sprite/underline.zig index b22db4f52..c60fd71b7 100644 --- a/src/font/sprite/underline.zig +++ b/src/font/sprite/underline.zig @@ -133,7 +133,7 @@ const Draw = struct { while (i < dot_count) : (i += 2) { // Ensure we never go out of bounds for the rect const x = @min(i * dot_width, self.width - 1); - const width = @min(self.width - 1 - x, dot_width); + const width = @min(self.width - x, dot_width); canvas.rect(.{ .x = @intCast(i * dot_width), .y = @intCast(y), @@ -154,7 +154,7 @@ const Draw = struct { while (i < dash_count) : (i += 2) { // Ensure we never go out of bounds for the rect const x = @min(i * dash_width, self.width - 1); - const width = @min(self.width - 1 - x, dash_width); + const width = @min(self.width - x, dash_width); canvas.rect(.{ .x = @intCast(x), .y = @intCast(y),