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

Inject measure funcs directly into UiSurface #17779

Open
ickshonpe opened this issue Feb 10, 2025 · 0 comments
Open

Inject measure funcs directly into UiSurface #17779

ickshonpe opened this issue Feb 10, 2025 · 0 comments
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change

Comments

@ickshonpe
Copy link
Contributor

What problem does this solve or what need does it fill?

Atm we set measure funcs indirectly using the ContentSize component. If a new measure is required for some content the content's update system has to wrap the measure inside a NodeMeasure enum which is then wrapped inside an Option. In ui_system_layout we take it out the option and pass it taffy which stores it in its node_context_data slotmap. This seems unnecessarily overcomplicated.

What solution would you like?

Instead the systems that update the measure funcs could just retrieve UiSurface and call its update_node_context method to inject the measure directly.

@ickshonpe ickshonpe added A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

No branches or pull requests

1 participant