public function __construct(PointDataInterface $position) { parent::__construct($position->getX(), $position->getY()); }
public function __construct(PointDataInterface $position, PointDataInterface $size) { parent::__construct($position); $this->size = new Size($size->getX(), $size->getY()); }
public function withSize(PointDataInterface $size) { $rect = clone $this; $rect->size = new Size($size->getX(), $size->getY()); return $rect; }
public function transformPoint(PointDataInterface $point) { $x = $point->getX(); $y = $point->getY(); return new Point($this->a * $x + $this->c * $y + $this->tx, $this->b * $x + $this->d * $y + $this->ty); }