예제 #1
0
 public function translate($x, $y)
 {
     if (!$x && !$y) {
         return;
     }
     parent::translate($x, $y);
     foreach ($this->getChildren() as $child) {
         $child->translate($x, $y);
     }
 }
 public function format(Nodes\Node $node, Document $document)
 {
     $boundary = $node->getBoundary();
     if (!$boundary->isClosed()) {
         list($x, $y) = $boundary->getFirstPoint()->toArray();
         $attributesSnapshot = $node->getAttributesSnapshot();
         $diffWidth = $node->getWidth() - $attributesSnapshot['width'];
         $width = $node->getWidth();
         $x += $width;
         $yEnd = $y - $node->getHeight();
         $boundary->setNext($x, $y)->setNext($x, $yEnd)->setNext($x - $width, $yEnd)->close();
         if ($node->hadAutoMargins()) {
             $node->translate(-$diffWidth / 2, 0);
         }
     }
 }
예제 #3
0
 public function translate($x, $y)
 {
     parent::translate($x, $y);
     foreach ($this->pointsOfWordsLines as $i => $point) {
         $this->pointsOfWordsLines[$i] = $point->translate($x, $y);
     }
 }