From 31a3ed70f030eb2996669d07049dc2a831d8bdd9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 5 Dec 2020 23:52:40 +0100 Subject: [PATCH] LibWeb: Hit test floats using the top of lines, not middle I don't know why basing the available space between floats on the y coordinate in the middle of each line seemed like a good idea. It just creates situations with a few pixels of floats overlapping text! --- Libraries/LibWeb/Layout/InlineFormattingContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Layout/InlineFormattingContext.cpp b/Libraries/LibWeb/Layout/InlineFormattingContext.cpp index 9667973461..ac914a2314 100644 --- a/Libraries/LibWeb/Layout/InlineFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/InlineFormattingContext.cpp @@ -56,7 +56,7 @@ static AvailableSpaceForLineInfo available_space_for_line(const InlineFormatting // FIXME: This is a total hack guess since we don't actually know the final y position of lines here! float line_height = context.context_box().specified_style().line_height(context.context_box()); - float y = (line_index * line_height) + line_height / 2; + float y = (line_index * line_height); auto& bfc = static_cast(*context.parent());