Skip to content

Commit e42b73d

Browse files
committed
Fix outline logic.
1 parent 30c80dc commit e42b73d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pg/inputPixelEditor/utils/getOutline.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function getOutline(grid) {
8686

8787
for (let y = 0; y < rows; y++) {
8888
for (let x = 0; x < cols; x++) {
89-
if (grid[y][x] !== 1) continue;
89+
if (grid[y][x] === 0) continue;
9090

9191
const dirs = [[1,0],[-1,0],[0,1],[0,-1]];
9292
for (const [dx, dy] of dirs) {
@@ -95,7 +95,7 @@ export function getOutline(grid) {
9595
if (
9696
nx < 0 || nx >= cols ||
9797
ny < 0 || ny >= rows ||
98-
(grid[ny][nx] === 0 && outside[ny][nx])
98+
(grid[ny][nx] !== 1 && outside[ny][nx])
9999
) {
100100
boundary.add(key(x, y));
101101
break;

0 commit comments

Comments
 (0)