示例#1
0
        void GDIPaint(ScGraphics g, ScDrawNode node)
        {
            if (node == null)
            {
                return;
            }

            ScLayer layer = node.layer;

            if (node.rootLayer == null)
            {
                g.SetClip(node.clipRect);
                g.Transform = layer.GlobalMatrix;
                g.layer     = layer;
                layer.OnGDIPaint(g);
            }
            else
            {
                ScLayer rootLayer = node.rootLayer;

                Matrix m = new Matrix();
                m.Translate(-rootLayer.DrawBox.X, -rootLayer.DrawBox.Y);
                m.Multiply(layer.GlobalMatrix);

                g.SetClip(node.clipRect);
                g.Transform = m;
                g.layer     = layer;
                layer.OnGDIPaint(g);
                m.Dispose();
            }

            g.layer = null;
            g.ResetTransform();
            g.ResetClip();
        }
示例#2
0
        void GDIPaintLayer(GDIGraphics g, ScDrawNode node)
        {
            if (node == null)
            {
                return;
            }

            ScLayer layer = node.layer;

            g.SetClip(node.clipRect);
            g.Transform = node.m;
            layer.OnGDIPaint(g);
            g.ResetTransform();
            g.ResetClip();

            node.m.Dispose();
        }