This is a 3 part blog series documenting the development of a flood fill to corners node for Substance Designer. You can get the node on my store here https://www.artstation.com/a/2996658. The blog post links:
https://www.artstation.com/blogs/benwilson/PlRE/flood-fill-to-corners-development-part-1
https://www.artstation.com/blogs/benwilson/y0q9/flood-fill-to-corners-development-part-2
https://www.artstation.com/blogs/benwilson/2WpV/flood-fill-to-corners-development-part-3