File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function breadthFirstFill(
105105
106106 if ( rgbData [ currentLocation [ 0 ] ] [ currentLocation [ 1 ] ] === targetColor ) {
107107 rgbData [ currentLocation [ 0 ] ] [ currentLocation [ 1 ] ] = replacementColor
108- for ( const neighborLocation of neighbors ( currentLocation ) ) {
108+ for ( const neighborLocation of neighbors ( rgbData , currentLocation ) ) {
109109 queue . push ( neighborLocation )
110110 }
111111 }
@@ -122,7 +122,7 @@ function breadthFirstFill(
122122function depthFirstFill ( rgbData , location , targetColor , replacementColor ) {
123123 if ( rgbData [ location [ 0 ] ] [ location [ 1 ] ] === targetColor ) {
124124 rgbData [ location [ 0 ] ] [ location [ 1 ] ] = replacementColor
125- for ( const neighborLocation of neighbors ( currentLocation ) ) {
125+ for ( const neighborLocation of neighbors ( rgbData , currentLocation ) ) {
126126 depthFirstFill ( rgbData , neighborLocation , targetColor , replacementColor )
127127 }
128128 }
You can’t perform that action at this time.
0 commit comments