0

Bug in MaterialHelper.ChangeOpacity

Anonymous 10 years ago 0
This discussion was imported from CodePlex

soheilvb wrote at 2012-04-14 00:35:

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.


objo wrote at 2012-04-14 00:38:

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;
            }