Beispiel #1
0
        /// <summary>
        /// Overridden.  Renders the fill for this node and then pushes the clip onto the
        /// paint context, so that when this node's children are rendered they will be
        /// clipped accordingly.
        /// </summary>
        /// <param name="paintContext">
        /// The paint context to use for painting this node.
        /// </param>
        protected override void Paint(PPaintContext paintContext)
        {
            Color b = Brush;

            if (b != null)
            {
                XnaGraphics g = paintContext.Graphics;
                g.FillPath(this.Matrix, b, this.PathReference);
            }
            //TEMP_REGION.MakeInfinite();
            //TEMP_REGION.Intersect(PathReference);
            paintContext.PushClip(TEMP_REGION);
        }
Beispiel #2
0
        //****************************************************************
        // Painting - Methods for painting a PPath.
        //****************************************************************

        /// <summary>
        /// Overridden.  See <see cref="PNode.Paint">PNode.Paint</see>.
        /// </summary>
        protected override void Paint(PPaintContext paintContext)
        {
            //System.Drawing.Brush b = this.Brush;
            XnaGraphics g = paintContext.Graphics;

            if (this.Brush != Color.Transparent)
            {
                //PointFx transformedPosition = MatrixExtensions.Transform(this.Matrix, new PointFx(1.0f, 1.0f));
                g.FillPath(this.Matrix, this.Brush, path);
            }

            if (pen != null)
            {
                g.DrawPath(pen, path);
            }
        }