예제 #1
0
        public override void RenderAction(IRenderable element, Graphics graphics, ControlRender render)
        {
            ComplexShape complex = element as ComplexShape;

            base.RenderAction(element, graphics, render);

            Region current = null;

            //Set up clipping if required
            if (complex.Clip)
            {
                Region region = new Region(complex.GetPath());
                current = graphics.Clip;
                graphics.SetClip(region, CombineMode.Intersect);
            }

            //Render the children
            if (complex.Children != null)
            {
                foreach (Solid solid in complex.RenderList)
                {
                    graphics.TranslateTransform(solid.Bounds.X, solid.Bounds.Y);

                    IFormsRenderer renderer = render.GetRenderer(solid);
                    renderer.RenderAction(solid, graphics, render);
                    graphics.TranslateTransform(-solid.Bounds.X, -solid.Bounds.Y);
                }
            }

            if (complex.Clip)
            {
                graphics.Clip = current;
            }
        }