예제 #1
0
 public function format(Node $node, Document $document)
 {
     $boundary = $node->getBoundary();
     $verticalMargins = $node->getMarginsBottomOfCells() + $node->getMarginsTopOfCells();
     $newHeight = $node->getMaxHeightOfCells() + $verticalMargins;
     $heightDiff = $newHeight - $node->getHeight();
     $boundary->pointTranslate(2, 0, $heightDiff)->pointTranslate(3, 0, $heightDiff);
     $node->setHeight($newHeight);
     foreach ((array) $node->getChildren() as $cell) {
         $heightDiff = $node->getMaxHeightOfCells() - $cell->getHeight();
         $cell->setHeight($node->getMaxHeightOfCells());
         $cell->getBoundary()->pointTranslate(2, 0, $heightDiff)->pointTranslate(3, 0, $heightDiff);
         $cell->translate(0, $node->getMarginsTopOfCells());
     }
 }