From a8a4ff4579f4fdedec0d84ecd1c668858933a62d Mon Sep 17 00:00:00 2001 From: Till Berger Date: Fri, 21 Jan 2022 17:00:06 +0100 Subject: [PATCH] Revert "Use margin height instead of border height in vertical alignment" This reverts commit 96a93459e06df326afee96a579f50d2594406237. 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 --- src/FrameReflower/Block.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FrameReflower/Block.php b/src/FrameReflower/Block.php index 9b5daccd2..7fc2ff1ab 100644 --- a/src/FrameReflower/Block.php +++ b/src/FrameReflower/Block.php @@ -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)) { @@ -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();