Пример #1
0
 public LineEnumerator(LocalRect rect, float height, Margins margins,
                       VerticalOrigin verticalOrigin)
 {
     _rect           = rect;
     _height         = height;
     _margins        = margins;
     _verticalOrigin = verticalOrigin;
     _index          = -1;
 }
Пример #2
0
        public LeapGrid(LocalRect rect, int numRows = 1, int numCols = 1,
                        Margins?cellMargins         = null, VerticalOrigin?verticalOrigin = null,
                        bool rowMajor = false)
        {
            var useMargins    = cellMargins.UnwrapOr(Margins.All(0f));
            var useVertOrigin = verticalOrigin.UnwrapOr(VerticalOrigin.Bottom);

            this.rect           = rect;
            this.numRows        = numRows;
            this.numCols        = numCols;
            this.cellMargins    = useMargins;
            this.verticalOrigin = useVertOrigin;
            this.rowMajor       = rowMajor;
        }
Пример #3
0
 public static LocalRect PadOuter(this LocalRect r, Margins margins)
 {
     return(new LocalRect(
                center: r.center + new Vector3(
                    (margins.right - margins.left) / 2f,
                    (margins.top - margins.bottom) / 2f,
                    0f
                    ),
                radii: new Vector2(
                    r.radii.x + (margins.right + margins.left) / 2f,
                    r.radii.y + (margins.top + margins.bottom) / 2f
                    )
                ));
 }
Пример #4
0
 public Rect(LocalRect localRect, Transform transform)
     : this(localRect.center, localRect.radii, transform)
 {
 }
Пример #5
0
 public static LocalRect PadInner(this LocalRect r, Margins margins)
 {
     return(r.PadOuter(-margins));
 }