mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Make CSSPixels and Length use 64-bit (double) floating point
This fixes a plethora of rounding problems on many websites. In the future, we may want to replace this with fixed-point arithmetic (bug #18566) for performance (and consistency with other engines), but in the meantime this makes the web look a bit better. :^) There's a lot more things that could be converted to doubles, which would reduce the amount of casting necessary in this patch. We can do that incrementally, however.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/655d9d1462 Pull-request: https://github.com/SerenityOS/serenity/pull/19012
@@ -994,7 +994,7 @@ void BlockFormattingContext::layout_list_item_marker(ListItemBox const& list_ite
|
||||
marker_state.set_content_height(max(image_height, marker.font().pixel_size_rounded_up() + 1).value());
|
||||
|
||||
marker_state.set_content_offset({ -(marker_state.content_width() + default_marker_width),
|
||||
max(CSSPixels(0.f), (CSSPixels(marker.line_height()) - marker_state.content_height()) / 2.f) });
|
||||
max(CSSPixels(0), (CSSPixels(marker.line_height()) - marker_state.content_height()) / 2) });
|
||||
|
||||
if (marker_state.content_height() > list_item_state.content_height())
|
||||
list_item_state.set_content_height(marker_state.content_height());
|
||||
|
||||
Reference in New Issue
Block a user