FillRectangle() public method

public FillRectangle ( Color c, float x, float y, float w, float h ) : void
c Color
x float
y float
w float
h float
return void
Ejemplo n.º 1
0
        internal void dbugPaintRuns(PaintVisitor p)
        {
            if (!PaintVisitor.dbugDrawWireFrame)
            {
                return;
            }
            //linebox
            float x1 = 0;
            float y1 = 0;
            float x2 = x1 + this.CachedLineContentWidth;
            float y2 = y1 + this.CacheLineHeight;

            //draw diagonal
            p.dbugDrawDiagonalBox(Color.Blue, x1, y1, x2, y2);
            //g.DrawRectangle(Pens.Blue,
            //    this.OwnerBox.LocationX,
            //    this.CachedLineTop,
            //    this.CachedLineContentWidth,
            //    this.CacheLineHeight);
            //foreach (var strip in _boxStrips.Values)
            //{
            //    var bound = strip.Bound;
            //    bound.Offset(offset);
            //    dbugDrawDiagnalBox(g, Pens.Green, bound.X, bound.Y, bound.Right, bound.Bottom);
            //}
            //return;
            foreach (CssRun w in _runs)
            {
                p.DrawRectangle(Color.DeepPink, w.Left, w.Top, w.Width, w.Height);
                //p.dbugDrawDiagonalBox(Color.DeepPink, w.Left, w.Top, w.Width, w.Height);
            }

            p.FillRectangle(Color.Red, 0, 0, 5, 5);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Paints the fragment
        /// </summary>
        /// <param name="g">the device to draw to</param>
        protected override void PaintImp(PaintVisitor p)
        {
#if DEBUG
            p.dbugEnterNewContext(this, PaintVisitor.PaintVisitorContextName.Init);
#endif
            Color bgColorHint = p.CurrentSolidBackgroundColorHint;//save
            var   rect        = new RectangleF(0, 0, this.VisualWidth, this.VisualHeight);
            if (rect.Height > 2 && RenderUtils.IsColorVisible(ActualBackgroundColor))
            {
                p.FillRectangle(ActualBackgroundColor, rect.Left, rect.Top, rect.Width, rect.Height);
            }

            if (rect.Height > 1)
            {
                p.PaintBorders(this, rect);
            }
            else
            {
                p.PaintBorder(this, CssSide.Top, this.BorderTopColor, rect);
            }
            p.CurrentSolidBackgroundColorHint = bgColorHint;//restore

#if DEBUG
            p.dbugExitContext();
#endif
        }
Ejemplo n.º 3
0
 public void Paint(CssBox box, PaintVisitor p)
 {
     p.FillRectangle(this.Color,
                     box.LocalX + this.HBoxShadowOffset,
                     box.LocalY + this.VBoxShadowOffset,
                     box.VisualWidth,
                     box.VisualHeight);
 }
Ejemplo n.º 4
0
 public void Paint(CssBox box, PaintVisitor p)
 {
     p.FillRectangle(this.Color,
         box.LocalX + this.HBoxShadowOffset,
         box.LocalY + this.VBoxShadowOffset,
         box.VisualWidth,
         box.VisualHeight);
 }
Ejemplo n.º 5
0
 public void PaintSelection(PaintVisitor p, CssLineBox line)
 {
     if (this.Kind == SelectionSegmentKind.FullLine)
     {
         p.FillRectangle(Color.LightGray,
                         0,
                         0,
                         line.CachedLineContentWidth,
                         line.CacheLineHeight);
     }
     else
     {
         p.FillRectangle(
             Color.LightGray,
             this.BeginAtPx, 0,
             this.WidthPx,
             (int)line.CacheLineHeight);
     }
 }
Ejemplo n.º 6
0
 public void PaintSelection(PaintVisitor p, CssLineBox line)
 {
     if (this.Kind == SelectionSegmentKind.FullLine)
     {
         p.FillRectangle(Color.LightGray,
                0,
                0,
                line.CachedLineContentWidth,
                line.CacheLineHeight);
     }
     else
     {
         p.FillRectangle(
          Color.LightGray,
          this.BeginAtPx, 0,
          this.WidthPx,
         (int)line.CacheLineHeight);
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Paints the fragment
        /// </summary>
        /// <param name="g">the device to draw to</param>
        protected override void PaintImp(PaintVisitor p)
        {
#if DEBUG
            p.dbugEnterNewContext(this, PaintVisitor.PaintVisitorContextName.Init);
#endif
            var rect = new RectangleF(0, 0, this.VisualWidth, this.VisualHeight);
            if (rect.Height > 2 && RenderUtils.IsColorVisible(ActualBackgroundColor))
            {
                p.FillRectangle(ActualBackgroundColor, rect.X, rect.Y, rect.Width, rect.Height);
            }

            if (rect.Height > 1)
            {
                p.PaintBorders(this, rect);
            }
            else
            {
                p.PaintBorder(this, CssSide.Top, this.BorderTopColor, rect);
            }
#if DEBUG
            p.dbugExitContext();
#endif
        }
Ejemplo n.º 8
0
        internal void dbugPaintRuns(PaintVisitor p)
        {
            if (!PaintVisitor.dbugDrawWireFrame)
            {
                return;
            }
            //linebox  
            float x1 = 0;
            float y1 = 0;
            float x2 = x1 + this.CachedLineContentWidth;
            float y2 = y1 + this.CacheLineHeight;
            //draw diagonal  
            p.dbugDrawDiagonalBox(Color.Blue, x1, y1, x2, y2);
            //g.DrawRectangle(Pens.Blue,
            //    this.OwnerBox.LocationX,
            //    this.CachedLineTop,
            //    this.CachedLineContentWidth,
            //    this.CacheLineHeight);
            //foreach (var strip in this._boxStrips.Values)
            //{
            //    var bound = strip.Bound;
            //    bound.Offset(offset);
            //    dbugDrawDiagnalBox(g, Pens.Green, bound.X, bound.Y, bound.Right, bound.Bottom);
            //} 
            //return; 
            foreach (CssRun w in this._runs)
            {
                p.DrawRectangle(Color.DeepPink, w.Left, w.Top, w.Width, w.Height);
                //p.dbugDrawDiagonalBox(Color.DeepPink, w.Left, w.Top, w.Width, w.Height);
            }

            p.FillRectangle(Color.Red, 0, 0, 5, 5);
        }