static BorderDirectional merge(BorderDirectional a, BorderDirectional b)
 {
     D.assert(a != null);
     D.assert(b != null);
     D.assert(BorderSide.canMerge(a.top, b.top));
     D.assert(BorderSide.canMerge(a.start, b.start));
     D.assert(BorderSide.canMerge(a.end, b.end));
     D.assert(BorderSide.canMerge(a.bottom, b.bottom));
     return(new BorderDirectional(
                top: BorderSide.merge(a.top, b.top),
                start: BorderSide.merge(a.start, b.start),
                end: BorderSide.merge(a.end, b.end),
                bottom: BorderSide.merge(a.bottom, b.bottom)
                ));
 }
Example #2
0
        public static Border merge(Border a, Border b)
        {
            D.assert(a != null);
            D.assert(b != null);
            D.assert(BorderSide.canMerge(a.top, b.top));
            D.assert(BorderSide.canMerge(a.right, b.right));
            D.assert(BorderSide.canMerge(a.bottom, b.bottom));
            D.assert(BorderSide.canMerge(a.left, b.left));

            return(new Border(
                       top: BorderSide.merge(a.top, b.top),
                       right: BorderSide.merge(a.right, b.right),
                       bottom: BorderSide.merge(a.bottom, b.bottom),
                       left: BorderSide.merge(a.left, b.left)
                       ));
        }
Example #3
0
        public override ShapeBorder add(ShapeBorder other, bool reversed = false)
        {
            if (!(other is Border border))
            {
                return(null);
            }

            if (BorderSide.canMerge(this.top, border.top) &&
                BorderSide.canMerge(this.right, border.right) &&
                BorderSide.canMerge(this.bottom, border.bottom) &&
                BorderSide.canMerge(this.left, border.left))
            {
                return(merge(this, border));
            }

            return(null);
        }