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

SetMesureText and SetQueryScrollOffset takes userData #212

Merged
merged 3 commits into from
Jan 19, 2025

Conversation

emoon
Copy link
Contributor

@emoon emoon commented Jan 19, 2025

Fixes #63

This is a breaking change due to new parameter. I set it to 0 in all cases except the SDL2 case where I used it as an example of passing the font data.

Another change now is because the userData is set inside the context object Clay_Initialize has to be called before calling this.

@nicbarker
Copy link
Owner

Thank you! I was literally implementing this last night 😁
I'll just implement passing the raylib fonts through in the same way as the SDL ones and we should be good to go.

Another change now is because the userData is set inside the context object Clay_Initialize has to be called before calling this.

Yeah, it's not super obvious the required order. Soon I think we'll change initialize to take a config struct that includes both the dimensions and the measure text function, which will get auto init to NULL if not provided 😁

@nicbarker
Copy link
Owner

Actually, I think it's fine to just merge this now and fix up the raylib example later - I'd like to switch the fontId to a uintptr_t anyway, as it's currently not very ergonomic to use.

@nicbarker nicbarker merged commit e8025cc into nicbarker:main Jan 19, 2025
3 checks passed
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.

[Core] UserData for Clay_SetMeasureTextFunction
2 participants