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

Merge branch '8-fix-last-column-cell-borders' into 'master'

Resolve "Fix last column cell borders"

Closes #8

See merge request !8
parents 915a1019 91bb242f
No related branches found
No related tags found
1 merge request!8Resolve "Fix last column cell borders"
Pipeline #7801 passed
Fix cells borders.
Correction sur les bordures des cellules.
...@@ -157,26 +157,24 @@ class CellWidget extends StatelessWidget { ...@@ -157,26 +157,24 @@ class CellWidget extends StatelessWidget {
borders = Border( borders = Border(
top: BorderSide( top: BorderSide(
width: cellBorderWidth, width: cellBorderWidth,
color: (hasBlockBorderTop || color: (hasBlockBorderTop || (cell.location.row == 0))
(((cell.location.row) % activity.board.boardSizeVertical) == 0))
? cellBorderDarkColor ? cellBorderDarkColor
: cellBorderLightColor), : cellBorderLightColor),
left: BorderSide( left: BorderSide(
width: cellBorderWidth, width: cellBorderWidth,
color: (hasBlockBorderLeft || color: (hasBlockBorderLeft || (cell.location.col == 0))
(((cell.location.col) % activity.board.boardSizeHorizontal) == 0))
? cellBorderDarkColor ? cellBorderDarkColor
: cellBorderLightColor), : cellBorderLightColor),
right: BorderSide( right: BorderSide(
width: cellBorderWidth, width: cellBorderWidth,
color: (hasBlockBorderRight || color: (hasBlockBorderRight ||
((((cell.location.col) + 1) % activity.board.boardSizeHorizontal) == 0)) ((cell.location.col + 1) == activity.board.boardSizeHorizontal))
? cellBorderDarkColor ? cellBorderDarkColor
: cellBorderLightColor), : cellBorderLightColor),
bottom: BorderSide( bottom: BorderSide(
width: cellBorderWidth, width: cellBorderWidth,
color: (hasBlockBorderBottom || color: (hasBlockBorderBottom ||
((((cell.location.row) + 1) % activity.board.boardSizeVertical) == 0)) ((cell.location.row + 1) == activity.board.boardSizeVertical))
? cellBorderDarkColor ? cellBorderDarkColor
: cellBorderLightColor), : cellBorderLightColor),
); );
......
...@@ -47,36 +47,30 @@ class GameBoardWidget extends StatelessWidget { ...@@ -47,36 +47,30 @@ class GameBoardWidget extends StatelessWidget {
children: [ children: [
CellWidget( CellWidget(
cell: currentActivity.board.get(CellLocation.go(row, col)), cell: currentActivity.board.get(CellLocation.go(row, col)),
hasBlockBorderBottom: hasBlockBorderBottom: currentActivity.board
row == currentActivity.board.boardSizeVertical || .get(CellLocation.go(row, col))
currentActivity.board .blockId !=
.get(CellLocation.go(row, col))
.blockId !=
currentActivity.board
.get(CellLocation.go(row + 1, col))
.blockId,
hasBlockBorderLeft: col == 0 ||
currentActivity.board currentActivity.board
.get(CellLocation.go(row, col)) .get(CellLocation.go(row + 1, col))
.blockId != .blockId,
currentActivity.board hasBlockBorderLeft: currentActivity.board
.get(CellLocation.go(row, col - 1)) .get(CellLocation.go(row, col))
.blockId, .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 ||
currentActivity.board currentActivity.board
.get(CellLocation.go(row, col)) .get(CellLocation.go(row, col - 1))
.blockId != .blockId,
currentActivity.board hasBlockBorderRight: currentActivity.board
.get(CellLocation.go(row - 1, col)) .get(CellLocation.go(row, col))
.blockId, .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. ...@@ -3,7 +3,7 @@ description: A suguru game application.
publish_to: "none" publish_to: "none"
version: 0.0.6+6 version: 0.0.7+7
environment: environment:
sdk: "^3.0.0" 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