1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

LibWeb: Don't do horizontal inline line layout twice for last line

After pruning empty last line boxes, we now avoid re-running the
horizontal fragment positioning step, since that would be wasted work.
This commit is contained in:
Andreas Kling 2022-01-22 10:32:49 +01:00
parent b1fd801436
commit 70a56d21dc
4 changed files with 27 additions and 8 deletions

View file

@ -33,6 +33,8 @@ public:
void update_last_line();
void remove_last_line_if_empty();
private:
bool should_break(LayoutMode, float next_item_width, bool should_force_break);
@ -40,6 +42,8 @@ private:
float m_available_width_for_current_line { 0 };
float m_current_y { 0 };
float m_max_height_on_current_line { 0 };
bool m_last_line_needs_update { false };
};
}