示例#1
0
 public function __construct(PointDataInterface $position)
 {
     parent::__construct($position->getX(), $position->getY());
 }
示例#2
0
 public function __construct(PointDataInterface $position, PointDataInterface $size)
 {
     parent::__construct($position);
     $this->size = new Size($size->getX(), $size->getY());
 }
示例#3
0
 public function withSize(PointDataInterface $size)
 {
     $rect = clone $this;
     $rect->size = new Size($size->getX(), $size->getY());
     return $rect;
 }
示例#4
0
 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);
 }