File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function breadthFirstFill(
105
105
106
106
if ( rgbData [ currentLocation [ 0 ] ] [ currentLocation [ 1 ] ] === targetColor ) {
107
107
rgbData [ currentLocation [ 0 ] ] [ currentLocation [ 1 ] ] = replacementColor
108
- for ( const neighborLocation of neighbors ( currentLocation ) ) {
108
+ for ( const neighborLocation of neighbors ( rgbData , currentLocation ) ) {
109
109
queue . push ( neighborLocation )
110
110
}
111
111
}
@@ -122,7 +122,7 @@ function breadthFirstFill(
122
122
function depthFirstFill ( rgbData , location , targetColor , replacementColor ) {
123
123
if ( rgbData [ location [ 0 ] ] [ location [ 1 ] ] === targetColor ) {
124
124
rgbData [ location [ 0 ] ] [ location [ 1 ] ] = replacementColor
125
- for ( const neighborLocation of neighbors ( currentLocation ) ) {
125
+ for ( const neighborLocation of neighbors ( rgbData , currentLocation ) ) {
126
126
depthFirstFill ( rgbData , neighborLocation , targetColor , replacementColor )
127
127
}
128
128
}
You can’t perform that action at this time.
0 commit comments