コード例 #1
0
ファイル: TallBox.php プロジェクト: tomkyle/yaphr
 public function __construct($height, BoxInterface $original)
 {
     $ratio = $original->getWidth() / $original->getHeight();
     $this->width = $height * $ratio;
     $this->height = $height;
 }
コード例 #2
0
ファイル: BoxTest.php プロジェクト: nicodmf/Imagine
 /**
  * @covers Imagine\Image\Box::contains
  *
  * @dataProvider getSizeBoxStartAndExpected
  *
  * @param BoxInterface       $size
  * @param BoxInterface       $box
  * @param PointInterface $start
  * @param Boolean             $expected
  */
 public function testShouldDetermineIfASizeContainsABoxAtAStartPosition(BoxInterface $size, BoxInterface $box, PointInterface $start, $expected)
 {
     $this->assertEquals($expected, $size->contains($box, $start));
 }
コード例 #3
0
 public function __construct(BoxInterface $inner, BoxInterface $outer)
 {
     $this->x = $outer->getWidth() / 2 - $inner->getWidth() / 2;
     $this->y = $outer->getHeight() / 2 - $inner->getHeight() / 2;
 }