Bug in MaterialHelper.ChangeOpacity

Apr 13, 2012 at 11:35 PM

hi again .

in MaterialHelper.ChangeOpacity you forgot to add support for ImageBrush :

I just add this lines

var scbi = dm.Brush as ImageBrush;
                if (scbi != null)
                {
                    scbi.Opacity = d;
                }

after

            if (scb != null)
                {
                    scb.Opacity = d;
                }

and problem solved.

Coordinator
Apr 13, 2012 at 11:38 PM
Edited Apr 13, 2012 at 11:39 PM

Thanks for pointing this out! Actually, the code could be changed to

            var dm = material as DiffuseMaterial;
            if (dm != null && dm.Brush != null)
            {
                dm.Brush.Opacity = d;
            }