Install zendframework via composer, update build.xml and run, updates to composer
[openemr.git] / vendor / dompdf / dompdf / src / Positioner / Block.php
blobfdb4180961219d2118045bde64e159c5c5419de1
1 <?php
2 /**
3 * @package dompdf
4 * @link http://dompdf.github.com/
5 * @author Benj Carson <benjcarson@digitaljunkies.ca>
6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
7 */
9 namespace Dompdf\Positioner;
11 use Dompdf\FrameDecorator\AbstractFrameDecorator;
13 /**
14 * Positions block frames
16 * @access private
17 * @package dompdf
19 class Block extends AbstractPositioner {
22 function __construct(AbstractFrameDecorator $frame)
24 parent::__construct($frame);
27 //........................................................................
29 function position()
31 $frame = $this->_frame;
32 $style = $frame->get_style();
33 $cb = $frame->get_containing_block();
34 $p = $frame->find_block_parent();
36 if ($p) {
37 $float = $style->float;
39 if (!$float || $float === "none") {
40 $p->add_line(true);
42 $y = $p->get_current_line_box()->y;
44 } else {
45 $y = $cb["y"];
48 $x = $cb["x"];
50 // Relative positionning
51 if ($style->position === "relative") {
52 $top = $style->length_in_pt($style->top, $cb["h"]);
53 //$right = $style->length_in_pt($style->right, $cb["w"]);
54 //$bottom = $style->length_in_pt($style->bottom, $cb["h"]);
55 $left = $style->length_in_pt($style->left, $cb["w"]);
57 $x += $left;
58 $y += $top;
61 $frame->set_position($x, $y);