Rectangle.fromLTRB constructor

Rectangle.fromLTRB(
  1. double _left,
  2. double _top,
  3. double _right,
  4. double _bottom,
)

Constructs the Rectangle from left, top, right and bottom edges.

If the edges are given in the wrong order (e.g. left is to the right from right), then they will be swapped.

Implementation

Rectangle.fromLTRB(this._left, this._top, this._right, this._bottom) {
  if (_left > _right) {
    final tmp = _left;
    _left = _right;
    _right = tmp;
  }
  if (_top > _bottom) {
    final tmp = _top;
    _top = _bottom;
    _bottom = tmp;
  }
}