DFRect.fromCenter constructor
DFRect.fromCenter({
- required DFPosition center,
- required double width,
- 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;
}