From ef33a40b99d32cbcf6672427ff8c5de2ede545a6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 3 Mar 2022 12:55:02 +0100 Subject: [PATCH] LibWeb: Remove bogus line box width adjustment This basically reverts 95715f0c8f066b2bb43b9dbb4dec993bb627fd9f, as it was totally wrong for text-align:center and text-align:right. --- Userland/Libraries/LibWeb/Layout/LineBuilder.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp index 6995ff0214..2a4d80bb75 100644 --- a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp +++ b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp @@ -158,11 +158,6 @@ void LineBuilder::update_last_line() return line_box_baseline; }(); - // Now we're going to align our fragments on the inline axis. - // We need to remember how much the last fragment on the line was moved by this process, - // since that is used to compute the final width of the entire line box. - float last_fragment_x_adjustment = 0; - for (size_t i = 0; i < line_box.fragments().size(); ++i) { auto& fragment = line_box.fragments()[i]; @@ -195,7 +190,6 @@ void LineBuilder::update_last_line() } } - last_fragment_x_adjustment = new_fragment_x - fragment.offset().x(); fragment.set_offset({ new_fragment_x, new_fragment_y }); bottom = max(bottom, new_fragment_y + fragment.height() + fragment.border_box_bottom()); @@ -214,9 +208,6 @@ void LineBuilder::update_last_line() } } - if (!line_box.fragments().is_empty()) - line_box.m_width += last_fragment_x_adjustment; - line_box.m_bottom = bottom; line_box.m_baseline = line_box_baseline; }