Ejemplo n.º 1
0
 /**
  * @param NodeInfo $node
  * @return string
  */
 protected function renderNode(NodeInfo $node)
 {
     if ($node->visible()) {
         $rect = $node->rectangle();
         $content = $this->contentHtml($node->content());
         return "<div style='left:{$rect->left}px;top:{$rect->top}px;width:{$rect->width}px;height:{$rect->height}px;background-color:{$node->background()}'>{$content}</div>";
     } else {
         return "";
     }
 }
Ejemplo n.º 2
0
 /**
  * @param NodeInfo $info
  * @return array
  */
 protected function mapNode(NodeInfo $info)
 {
     if ($info->visible()) {
         $content = $info->content()->content();
         foreach ($content as $id => $line) {
             $content[$id][1] += $info->rectangle()->left;
             $content[$id][2] += $info->rectangle()->top;
         }
         return [$info->rectangle()->left, $info->rectangle()->top, $info->rectangle()->width, $info->rectangle()->height, $info->background(), $content, $info->level(), $info->isLeaf(), $info->isRoot()];
     } else {
         return false;
     }
 }