mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +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
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
Add a link
Reference in a new issue