Hi,

Your design reminds me of the Plug & Paint example and its friends. You should take a look at them to see if you can grab something to fix your issue.