mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Migrate ListItemMarkerBox's text from ByteString to String
This commit is contained in:
parent
8b52a354fa
commit
b987d53926
Notes:
github-actions[bot]
2025-02-11 09:40:28 +00:00
Author: https://github.com/AtkinsSJ
Commit: b987d53926
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3528
5 changed files with 16 additions and 15 deletions
|
@ -1210,12 +1210,12 @@ void BlockFormattingContext::ensure_sizes_correct_for_left_offset_calculation(Li
|
|||
|
||||
auto default_marker_width = max(4, marker.first_available_font().pixel_size_rounded_up() - 4);
|
||||
|
||||
auto marker_text = marker.text().value_or("");
|
||||
auto marker_text = marker.text().value_or({});
|
||||
if (marker_text.is_empty()) {
|
||||
marker_state.set_content_width(image_width + default_marker_width);
|
||||
} else {
|
||||
// FIXME: Use per-code-point fonts to measure text.
|
||||
auto text_width = marker.first_available_font().width(marker_text);
|
||||
auto text_width = marker.first_available_font().width(marker_text.code_points());
|
||||
marker_state.set_content_width(image_width + CSSPixels::nearest_value_for(text_width));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue