Skip to content

Commit

Permalink
Revert "Use margin height instead of border height in vertical alignm…
Browse files Browse the repository at this point in the history
…ent"

This reverts commit 96a9345. It seems
this was not an innocent fix as it seemed to be. Retain the existing
behavior, which unfortunately undoes the small improvement to #1946.

Fixes #2756
  • Loading branch information
Mellthas committed Jan 21, 2022
1 parent 0ba53a9 commit a8a4ff4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/FrameReflower/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ function vertical_align()
continue;
}

$marginHeight = $frame->get_margin_height();
$imageHeightDiff = $height * 0.8 - $marginHeight;
$frameBox = $frame->get_border_box();
$imageHeightDiff = $height * 0.8 - $frameBox["h"];

$align = $frame->get_style()->vertical_align;
if (in_array($align, Style::$vertical_align_keywords, true)) {
Expand Down Expand Up @@ -635,7 +635,7 @@ function vertical_align()
break;
}
} else {
$y_offset = $baseline - (float)$style->length_in_pt($align, $style->font_size) - $marginHeight;
$y_offset = $baseline - (float)$style->length_in_pt($align, $style->font_size) - $frameBox["h"];
}
} else {
$parent = $frame->get_parent();
Expand Down

0 comments on commit a8a4ff4

Please sign in to comment.