commit 05c5668acfd9653b20d6735dce6135f2528599d5
parent cfca86991dba9be77d592d798095eac8cb4642fb
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Wed, 31 May 2023 03:04:12 -0700
fmt
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/pkg/web/handlers/api/v1/chess.go b/pkg/web/handlers/api/v1/chess.go
@@ -140,8 +140,7 @@ func renderSquare(ctx *gg.Context, sq chess.Square, last *chess.Move, turn chess
ctx.Pop()
// Draw previous move
if last != nil {
- if last.S1() == sq ||
- last.S2() == sq {
+ if last.S1() == sq || last.S2() == sq {
ctx.Push()
ctx.SetRGBA(0, 1, 0, 0.1)
ctx.DrawRectangle(float64(x), float64(y), sqSize, sqSize)
@@ -160,12 +159,10 @@ func renderSquare(ctx *gg.Context, sq chess.Square, last *chess.Move, turn chess
}
}
}
-
// draw piece
p := sqPiece
if p != chess.NoPiece {
img := getFile("img/chess/" + p.Color().String() + pieceTypeMap[p.Type()] + ".png")
-
ctx.Push()
ctx.DrawImage(img, x, y)
ctx.Pop()