MATLAB: Turning HitTest off for imrect

hittestimrect

I have been trying to turn the HitTest property off for an imrect object, such that I can click on objects behind it. However, a simple "set(imrectHan,'HitTest','off');" does not do the trick. Does anyone know how to solve this?

Best Answer

The imrect is built from low-level lines and patches so turn the imrect's Children's 'HitTest' off.
h = imrect
set(get(h,'Children'),'HitTest','off')