public function __construct($height, BoxInterface $original) { $ratio = $original->getWidth() / $original->getHeight(); $this->width = $height * $ratio; $this->height = $height; }
public function __construct(BoxInterface $inner, BoxInterface $outer) { $this->x = $outer->getWidth() / 2 - $inner->getWidth() / 2; $this->y = $outer->getHeight() / 2 - $inner->getHeight() / 2; }