mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
LibWeb: Move FFC layout algorithm step 2 into a separate function
Determining the available main and cross space is now done by a separate function. The signature is a little bit hairy since this function computes some things that are used by subsequent algorithm steps. Factoring can definitely be improved further.
This commit is contained in:
parent
cd6b97ab9e
commit
c19358e157
2 changed files with 77 additions and 61 deletions
|
@ -50,6 +50,12 @@ private:
|
|||
|
||||
void generate_anonymous_flex_items(Box& flex_container, Vector<FlexItem>&);
|
||||
|
||||
struct AvailableSpace {
|
||||
float main { 0 };
|
||||
float cross { 0 };
|
||||
};
|
||||
AvailableSpace determine_available_main_and_cross_space(Box const& flex_container, bool& main_size_is_infinite, bool& main_is_constrained, bool& cross_is_constrained, float& main_min_size, float& main_max_size, float& cross_min_size, float& cross_max_size) const;
|
||||
|
||||
bool is_row_layout() const { return m_flex_direction == CSS::FlexDirection::Row || m_flex_direction == CSS::FlexDirection::RowReverse; }
|
||||
|
||||
CSS::FlexDirection m_flex_direction {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue