From 7c6e42c2d4130f5170655a3af23275411a109a0c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 29 Sep 2022 13:20:22 +0200 Subject: [PATCH] LibWeb: Fix bogus comparison when measuring if a float can fit We were using `>=` instead of `>` when checking if a float with a given width could fit in the available space. If the width was an exact match, we rejected it! Oops :^) --- Userland/Libraries/LibWeb/Layout/LineBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp index 6f39763637..f1eab830f8 100644 --- a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp +++ b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp @@ -112,7 +112,7 @@ float LineBuilder::y_for_float_to_be_inserted_here(Box const& box) while (true) { auto space_at_y_top = m_context.available_space_for_line(candidate_y); auto space_at_y_bottom = m_context.available_space_for_line(candidate_y + height); - if (width >= space_at_y_top || width >= space_at_y_bottom) { + if (width > space_at_y_top || width > space_at_y_bottom) { if (!m_context.any_floats_intrude_at_y(candidate_y) && !m_context.any_floats_intrude_at_y(candidate_y + height)) { return candidate_y; }