Skip to content

Conversation

@Leedehai
Copy link
Contributor

This is a refactoring PR for better readability.

This PR renamed MathContext's layout_fragment/layout_fragments/layout_row/layout_frame into layout_into_fragment/layout_into_fragments/layout_into_row/layout_into_frame, because these four functions are laying out an input math-layoutable elem into the intended type: MathFragment, Vec<MathFragment>, MathRow, Frame.

They are different from the other layout_*() methods: e.g. layout_content lays out a Content (not laying out an elem into a Content), layout_box lays out a BoxElem (not laying out an elem into a BoxElem) etc.

Renaming them helps differentiate the two kinds of layout*().

Plus, layout_root has exactly the same body as layout_row, and this PR unifies the two into layout_row.

@laurmaedje laurmaedje enabled auto-merge February 20, 2024 13:19
@laurmaedje laurmaedje added this pull request to the merge queue Feb 20, 2024
@laurmaedje
Copy link
Member

Nice, thanks!

Merged via the queue into typst:main with commit b3ed2df Feb 20, 2024
@Leedehai Leedehai deleted the layout_fragment branch February 20, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants