MATLAB: Does the patch get recreated when I just change the “FaceAlpha” property of the patch in MATLAB 6.5 (R13)

activexchangefacealphaMATLABpatchrecreated

When I execute the following code:
fh = figure;
ph = patch(...
[-1,-1,1,1],...
[-1,1,1,-1],...
[0 1 0 1],...
ones(1,4),...
'edgecolor','none',...
'visible','on',...
'facecolor',[0,0.75,0],...
'facealpha',0.9);
lh = actxcontrol('MsComctlLib.ListViewCtrl',[100,100,100,100],fh);
set(ph,'facealpha',1);
I expect the activeX control to be on the top of the patch object since it was created after creating the patch object. However, when I change the "FaceAlpha" property of the patch to "1", i.e. make it opaque, I can no longer see the activeX control. I can see it if I change the "FaceAlpha" value to anything less than 1 (i.e. make it transperant).

Best Answer

There is a bug in MATLAB 6.5 (R13) when using the PATCH function with its "FaceAlpha" property. This behavior occurs because the PATCH gets recreated when the "FaceAlpha" value is changed. Hence it comes on the top of the activeX control.
As a workaround, you can recreate the activeX control once the "FaceAlpha" property is changed.