Skip to content
Snippets Groups Projects
Commit 91bb242f authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Fix cell borders

parent 915a1019
No related branches found
Tags Release_0.1.0_9
1 merge request!8Resolve "Fix last column cell borders"
Pipeline #7797 passed
Fix cells borders.
Correction sur les bordures des cellules.
......@@ -157,26 +157,24 @@ class CellWidget extends StatelessWidget {
borders = Border(
top: BorderSide(
width: cellBorderWidth,
color: (hasBlockBorderTop ||
(((cell.location.row) % activity.board.boardSizeVertical) == 0))
color: (hasBlockBorderTop || (cell.location.row == 0))
? cellBorderDarkColor
: cellBorderLightColor),
left: BorderSide(
width: cellBorderWidth,
color: (hasBlockBorderLeft ||
(((cell.location.col) % activity.board.boardSizeHorizontal) == 0))
color: (hasBlockBorderLeft || (cell.location.col == 0))
? cellBorderDarkColor
: cellBorderLightColor),
right: BorderSide(
width: cellBorderWidth,
color: (hasBlockBorderRight ||
((((cell.location.col) + 1) % activity.board.boardSizeHorizontal) == 0))
((cell.location.col + 1) == activity.board.boardSizeHorizontal))
? cellBorderDarkColor
: cellBorderLightColor),
bottom: BorderSide(
width: cellBorderWidth,
color: (hasBlockBorderBottom ||
((((cell.location.row) + 1) % activity.board.boardSizeVertical) == 0))
((cell.location.row + 1) == activity.board.boardSizeVertical))
? cellBorderDarkColor
: cellBorderLightColor),
);
......
......@@ -47,36 +47,30 @@ class GameBoardWidget extends StatelessWidget {
children: [
CellWidget(
cell: currentActivity.board.get(CellLocation.go(row, col)),
hasBlockBorderBottom:
row == currentActivity.board.boardSizeVertical ||
currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row + 1, col))
.blockId,
hasBlockBorderLeft: col == 0 ||
hasBlockBorderBottom: currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row, col - 1))
.blockId,
hasBlockBorderRight:
col == currentActivity.board.boardSizeVertical ||
currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row, col + 1))
.blockId,
hasBlockBorderTop: row == 0 ||
.get(CellLocation.go(row + 1, col))
.blockId,
hasBlockBorderLeft: currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row - 1, col))
.blockId,
.get(CellLocation.go(row, col - 1))
.blockId,
hasBlockBorderRight: currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row, col + 1))
.blockId,
hasBlockBorderTop: currentActivity.board
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row - 1, col))
.blockId,
)
],
),
......
......@@ -3,7 +3,7 @@ description: A suguru game application.
publish_to: "none"
version: 0.0.6+6
version: 0.0.7+7
environment:
sdk: "^3.0.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment