Пример #1
0
        public override void paint(Canvas canvas, Rect rect, TextDirection?textDirection = null)
        {
            switch (side.style)
            {
            case BorderStyle.none:
                break;

            case BorderStyle.solid:
                float width = side.width;
                if (width == 0.0)
                {
                    canvas.drawRRect(_adjustBorderRadius(rect, textDirection).toRRect(_adjustRect(rect)),
                                     side.toPaint());
                }
                else
                {
                    RRect outer = _adjustBorderRadius(rect, textDirection).toRRect(_adjustRect(rect));
                    RRect inner = outer.deflate(width);
                    Paint paint = new Paint {
                        color = side.color,
                    };
                    canvas.drawDRRect(outer, inner, paint);
                }

                break;
            }
        }
Пример #2
0
        static void _paintUniformBorderWithRectangle(Canvas canvas, Rect rect, BorderSide side)
        {
            D.assert(side.style != BorderStyle.none);
            double width = side.width;
            Paint  paint = side.toPaint();

            canvas.drawRect(rect.deflate(width / 2.0), paint);
        }
Пример #3
0
        internal override void _paintUniformBorderWithRectangle(Canvas canvas, Rect rect, BorderSide side)
        {
            D.assert(side.style != BorderStyle.none);
            float width = side.width;
            Paint paint = side.toPaint();

            canvas.drawRect(rect.deflate(width / 2.0f), paint);
        }
Пример #4
0
        static void _paintUniformBorderWithCircle(Canvas canvas, Rect rect, BorderSide side)
        {
            D.assert(side.style != BorderStyle.none);
            double width  = side.width;
            Paint  paint  = side.toPaint();
            double radius = (rect.shortestSide - width) / 2.0;

            canvas.drawCircle(rect.center, radius, paint);
        }
Пример #5
0
        internal override void _paintUniformBorderWithCircle(Canvas canvas, Rect rect, BorderSide side)
        {
            D.assert(side.style != BorderStyle.none);
            float width  = side.width;
            Paint paint  = side.toPaint();
            float radius = (rect.shortestSide - width) / 2.0f;

            canvas.drawCircle(rect.center, radius, paint);
        }
Пример #6
0
        public override void paint(Canvas canvas, Rect rect, TextDirection?textDirection = null)
        {
            switch (side.style)
            {
            case BorderStyle.none:
                break;

            case BorderStyle.solid:
                Radius radius = Radius.circular(rect.shortestSide / 2.0f);
                canvas.drawRRect(
                    RRect.fromRectAndRadius(rect, radius).deflate(side.width / 2.0f),
                    side.toPaint()
                    );
                break;
            }
        }
Пример #7
0
        public override void paint(Canvas canvas, Rect rect, TextDirection?textDirection = null)
        {
            if (rect.isEmpty)
            {
                return;
            }

            switch (side.style)
            {
            case BorderStyle.none:
                break;

            case BorderStyle.solid:
                Path path = getOuterPath(rect, textDirection);
                path.addPath(getInnerPath(rect, textDirection), Offset.zero);
                canvas.drawPath(path, side.toPaint());
                break;
            }
        }
Пример #8
0
        public override void paint(Canvas canvas, Rect rect, TextDirection?textDirection = null)
        {
            switch (side.style)
            {
            case BorderStyle.none:
                break;

            case BorderStyle.solid:
                canvas.drawCircle(rect.center, (rect.shortestSide - side.width) / 2.0f, side.toPaint());
                break;
            }
        }