DFRect.fromCenter constructor

DFRect.fromCenter({
  1. required DFPosition center,
  2. required double width,
  3. required double height,
})

创建矩形

Implementation

DFRect.fromCenter({ required DFPosition center, required this.width, required this.height}) {
  this.left = center.x - width / 2;
  this.top = center.y - height / 2;
  this.right = this.left + this.width;
  this.bottom = this.top + this.height;
}