Example #1
0
 /**
  * Determine current frame width based on contents
  *
  * @return float
  */
 public function calculate_auto_width()
 {
     $width = 0;
     foreach ($this->_frame->get_line_boxes() as $line) {
         $line_width = 0;
         foreach ($line->get_frames() as $frame) {
             if ($frame->get_original_style()->width == 'auto') {
                 $line_width += $frame->calculate_auto_width();
             } else {
                 $line_width += $frame->get_margin_width();
             }
         }
         $width = max($line_width, $width);
     }
     $this->_frame->get_style()->width = $width;
     return $this->_frame->get_margin_width();
 }