From 206f068a1f519d9b99d85375122901462ff4b951 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 20 Jan 2023 18:08:20 -0500 Subject: [PATCH] Fixed bug with the chiseled pattern --- artist/chisel.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/artist/chisel.go b/artist/chisel.go index b172ddb..1fd1d3b 100644 --- a/artist/chisel.go +++ b/artist/chisel.go @@ -13,9 +13,17 @@ func (chiseled Chiseled) AtWhen (x, y, width, height int) (c color.RGBA) { var highlighted bool // FIXME: this doesn't work quite right, the // slope of the line is somewhat off. - bottomCorner := - float64(x) < float64(y) * - (float64(width) / float64(height)) + // bottomCorner := + // float64(x) < float64(y) * + // (float64(width) / float64(height)) + bottomCorner := false + + if width > height { + bottomCorner = y > height / 2 + } else { + bottomCorner = x < width / 2 + } + if bottomCorner { highlighted = float64(x) < float64(height) - float64(y) } else {