mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibWeb: Perform horizontal inline alignment based on available space
Previously, we were using the full containing block width as a reference for text-align values "right" and "center". This didn't take intruding floats into account.
This commit is contained in:
parent
d43ef27761
commit
5efd63741f
Notes:
sideshowbarker
2024-07-17 06:43:39 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5efd63741f
1 changed files with 1 additions and 1 deletions
|
@ -184,7 +184,7 @@ void LineBuilder::update_last_line()
|
|||
float x_offset_bottom = m_context.leftmost_x_offset_at(m_current_y + current_line_height - 1);
|
||||
float x_offset = max(x_offset_top, x_offset_bottom);
|
||||
|
||||
float excess_horizontal_space = m_context.effective_containing_block_width() - line_box.width();
|
||||
float excess_horizontal_space = m_available_width_for_current_line - line_box.width();
|
||||
|
||||
switch (text_align) {
|
||||
case CSS::TextAlign::Center:
|
||||
|
|
Loading…
Add table
Reference in a new issue