-
Notifications
You must be signed in to change notification settings - Fork 25.1k
feat: calc support #56162
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
base: main
Are you sure you want to change the base?
feat: calc support #56162
Changes from all commits
81a65d2
12696b2
4c733b9
61455ea
3cda37b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,11 @@ struct LayoutContext { | |
| * If React Native takes up entire screen, it will be {0, 0}. | ||
| */ | ||
| Point viewportOffset{}; | ||
|
|
||
| /* | ||
| * Viewport size is size of the React Native's root view. | ||
| */ | ||
| Size viewportSize{}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooh, this may be helpful in more places in the future 👍. If you had a PR for just the plumbing for e.g. this part of the change, would be quick to import and accept.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I extracted it to the separated PR: #56209 |
||
| }; | ||
|
|
||
| inline bool operator==(const LayoutContext &lhs, const LayoutContext &rhs) | ||
|
|
@@ -68,13 +73,15 @@ inline bool operator==(const LayoutContext &lhs, const LayoutContext &rhs) | |
| lhs.affectedNodes, | ||
| lhs.swapLeftAndRightInRTL, | ||
| lhs.fontSizeMultiplier, | ||
| lhs.viewportOffset) == | ||
| lhs.viewportOffset, | ||
| lhs.viewportSize) == | ||
| std::tie( | ||
| rhs.pointScaleFactor, | ||
| rhs.affectedNodes, | ||
| rhs.swapLeftAndRightInRTL, | ||
| rhs.fontSizeMultiplier, | ||
| rhs.viewportOffset); | ||
| rhs.viewportOffset, | ||
| rhs.viewportSize); | ||
| } | ||
|
|
||
| } // namespace facebook::react | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why does this need to be a macro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not - I wrote it as macros because this file already achieve similar functionality using macros (
REBUILD_FIELD_YG_*stuff) and I got the feeling it would be more consistent.Would you like me to rewrite it using template functions?