Blocking mtouchIn input while interacting with UI overlay

I’m building a touchscreen painting app where the brush position is driven by an mtouchIn DAT (select, x, y). The brush drawing is handled in a TOP feedback network.

I also have a UI layer on top of the canvas (a Container COMP with color-selection buttons). The issue is that when I tap a UI button, the canvas underneath also receives the same touch event from mtouchIn, causing an unwanted paint stroke.

I tried momentarily setting the select channel to 0 to prevents the button press from registering and it works. This is still a hack as I ideally wouldn’t want to block the strokes on the rest of the canvas even when the overlay is open. I just want to prevent the clicks from seeping in through the UI overlay, enabling/disabling click through doesn’t work as the position is coming from mtouchIn

What’s the best practice for gating or blocking mtouchIn input during panel interactions, for example, when a button or container is active (panel.lselect == 1)?

Is there any way around this?