Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Layout Engine for Fiber Reconciler #472

Merged
merged 73 commits into from
May 30, 2022
Merged

Custom Layout Engine for Fiber Reconciler #472

merged 73 commits into from
May 30, 2022

Conversation

carson-katri
Copy link
Member

@carson-katri carson-katri commented Feb 21, 2022

This adds a layout pass to the WIP fiber reconciler, that should in theory be able to replicate SwiftUI layout 1:1 as it’s developed.

Screen Shot 2022-02-21 at 4 13 11 PM

In this example, Text is not measured and is a fixed size of 100x50.

Here are some things that are missing, but should be implemented (perhaps as separate PRs targeting this branch):

  • Renderer-specific Text measuring
  • alignmentGuide modifier
  • Coordinate Spaces
  • Disabling layout computations for renderers that don't, or optionally, use them
  • Layouts for all of the existing Views and modifiers, such as ZStack, .background, .overlay, .frame etc.

@carson-katri carson-katri added the enhancement New feature or request label Feb 21, 2022
@carson-katri carson-katri marked this pull request as draft February 21, 2022 21:38
@carson-katri
Copy link
Member Author

I've made some revisions, and it now seems to work well with simple examples:

Screen.Recording.2022-03-03.at.10.49.13.AM.mov

Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more formatting and doc comments nits

Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@carson-katri carson-katri merged commit 03513dd into main May 30, 2022
@carson-katri carson-katri deleted the fiber/layout branch May 30, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants