Skip to content

Commit

Permalink
Improved absolute positionning (must use the padding box)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien.menager committed Jun 24, 2011
1 parent 0b34a87 commit a45670f
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions dompdf/include/absolute_positioner.cls.php
Expand Up @@ -50,7 +50,15 @@ function position() {

$frame = $this->_frame;
$style = $frame->get_style();

$p = $frame->find_positionned_parent();

list($x, $y, $w, $h) = $frame->get_containing_block();

if ( $p ) {
// Get the parent's padding box (see http://www.w3.org/TR/CSS21/visuren.html#propdef-top)
list($x, $y) = $p->get_padding_box();
}

$top = $style->length_in_pt($style->top, $h);
$right = $style->length_in_pt($style->right, $w);
Expand All @@ -63,21 +71,6 @@ function position() {
$orig_width = $orig_style->width;
$orig_height = $orig_style->height;

/*$p = $frame->find_positionned_parent();
if ( $p ) {
// Get the parent's padding box (see http://www.w3.org/TR/CSS21/visuren.html#propdef-top)
list($x, $y, $w, $h) = $p->get_padding_box();
} else {
$x = $cb["x"];
$y = $cb["y"];
}*/

/*d("left: $left");
d("right: $right");
d("orig_width: $orig_width");
d("w: $w");*/

if ( $left !== "auto" ) {
$x += $left;
}
Expand Down

0 comments on commit a45670f

Please sign in to comment.