getRectangleByTileSize method

Rectangle<num> getRectangleByTileSize(
  1. double tileSize
)

Implementation

Rectangle getRectangleByTileSize(double tileSize) {
  final maxSize = max(this.width, this.height);
  final left = (this.left / tileSize).floorToDouble();
  final top = (this.top / tileSize).floorToDouble();
  final width = (maxSize / tileSize).ceilToDouble();
  final height = (maxSize / tileSize).ceilToDouble();

  return Rectangle(
    left,
    top,
    width,
    height,
  );
}