Fixed bug with the chiseled pattern

This commit is contained in:
Sasha Koshka 2023-01-20 18:08:20 -05:00
parent cfbb031500
commit 206f068a1f
1 changed files with 11 additions and 3 deletions

View File

@ -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 {