Example #1
0
        /// <summary>
        /// Paints the fragment
        /// </summary>
        /// <param name="g">the device to draw to</param>
        protected override void PaintImp(Graphics g)
        {
            var offset = HtmlContainer != null ? HtmlContainer.ScrollOffset : PointF.Empty;
            var rect   = new RectangleF(Bounds.X + offset.X, Bounds.Y + offset.Y, Bounds.Width, Bounds.Height);

            if (rect.Height > 2 && CssUtils.IsColorVisible(ActualBackgroundColor))
            {
                g.FillRectangle(CssUtils.GetSolidBrush(ActualBackgroundColor), rect);
            }

            var b1 = CssUtils.GetSolidBrush(ActualBorderTopColor);

            DrawingUtils.DrawBorder(Border.Top, g, this, b1, rect, true, true);

            if (rect.Height > 1)
            {
                var b2 = CssUtils.GetSolidBrush(ActualBorderLeftColor);
                DrawingUtils.DrawBorder(Border.Left, g, this, b2, rect, true, true);

                var b3 = CssUtils.GetSolidBrush(ActualBorderRightColor);
                DrawingUtils.DrawBorder(Border.Right, g, this, b3, rect, true, true);

                var b4 = CssUtils.GetSolidBrush(ActualBorderBottomColor);
                DrawingUtils.DrawBorder(Border.Bottom, g, this, b4, rect, true, true);
            }
        }