// ------------------------------------------------------------------
        /// <summary>
        /// Updates pens and brushes
        /// </summary>
        // ------------------------------------------------------------------
        protected virtual void UpdatePaintingMaterial()
        {
            // First make sure we have a valid rectangle.
            if (mRectangle.Width == 0)
            {
                mRectangle.Width = 1;
            }

            if (mRectangle.Height == 0)
            {
                mRectangle.Height = 1;
            }

            if (mPenStyle != null)
            {
                mPen = mPenStyle.DrawingPen();
            }

            if (mPaintStyle != null)
            {
                mBrush = mPaintStyle.GetBrush(this.Rectangle);
            }

            Invalidate();
        }
Example #2
0
 /// <summary>
 /// Updates pens and brushes
 /// </summary>
 protected virtual void UpdatePaintingMaterial()
 {
     if (mPenStyle != null)
     {
         mPen = mPenStyle.DrawingPen();
     }
     if (mPaintStyle != null)
     {
         mBrush = mPaintStyle.GetBrush(this.Rectangle);
     }
     Invalidate();
 }