fix crash in underline drawing math

This commit is contained in:
em-dash
2024-02-24 20:49:51 +11:00
parent a0c43a8566
commit 0f19251aa6

View File

@ -80,7 +80,7 @@ const Draw = struct {
// Ensure we never overflow out of bounds on the canvas // Ensure we never overflow out of bounds on the canvas
const y_max = self.height -| 1; const y_max = self.height -| 1;
const bottom = @min(self.pos + self.thickness, y_max); const bottom = @min(self.pos + self.thickness, y_max);
const y = @as(i32, @intCast(bottom - self.thickness)); const y = @as(i32, @intCast(bottom)) - @as(i32, @intCast(self.thickness));
canvas.rect(.{ canvas.rect(.{
.x = 0, .x = 0,