Rect.fromLTWH constructor

  1. @literal
const Rect.fromLTWH(
  1. int x,
  2. int y,
  3. int width,
  4. int height
)

Creates a new rectangle.

If either width or height is negative, they are clamped to zero.

Implementation

@literal
const Rect.fromLTWH(
  this.x,
  this.y,
  int width,
  int height,
)   : // coverage:ignore-start
      width = width < 0 ? 0 : width,
      height = height < 0 ? 0 : height;