Beispiel #1
0
 public function __construct($height, BoxInterface $original)
 {
     $ratio = $original->getWidth() / $original->getHeight();
     $this->width = $height * $ratio;
     $this->height = $height;
 }
Beispiel #2
0
 /**
  * @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));
 }
Beispiel #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;
 }